Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
330
Refreshing the XamWebChart
posted

Hi!

I have a requirement where I need to change the data bound to the lIne chart of XamWebChart.

I have the tag as below.

<

 

 

 

 

<igChart:XamWebChart.Legend>

<

igChart:Legend MouseLeftButtonUp="Legend_MouseLeftButtonUp" Visibility ="Visible" />

</

igChart:XamWebChart.Legend>

<

igChart:XamWebChart.Axes>

<

igChart:Axis AxisType="PrimaryX" AutoRange="False" Minimum="0" Maximum="31" Unit="1" FontFamily="Arial" FontSize="8" >

<

igChart:Axis.Label>

<

igChart:LabelGroup Foreground="Red" FontFamily="Arial" FontSize="8"/>

</

igChart:Axis.Label>

<

igChart:Axis.MajorGridline>

<

igChart:GridlineGroup StrokeThickness="0" Stroke="Red" Visibility="Collapsed"/>

</

igChart:Axis.MajorGridline>

<

igChart:Axis.MinorGridline>

<

igChart:GridlineGroup StrokeThickness="0" Visibility="Collapsed"/>

</

igChart:Axis.MinorGridline>

</

igChart:Axis>

<

igChart:Axis AxisType="PrimaryY" AutoRange="False" Minimum="0" Maximum="100" Unit="20" FontFamily="Arial" FontSize="8">

<

igChart:Axis.Label>

<

igChart:LabelGroup Foreground="Blue" FontFamily="Arial" FontSize="8"/>

</

igChart:Axis.Label>

<

igChart:Axis.MajorGridline>

<

igChart:GridlineGroup StrokeThickness="0" Stroke="Red" Visibility="Collapsed"/>

</

igChart:Axis.MajorGridline>

<

igChart:Axis.MinorGridline>

<

igChart:GridlineGroup StrokeThickness="0" Visibility="Collapsed"/>

</

igChart:Axis.MinorGridline>

</

igChart:Axis>

</

igChart:XamWebChart.Axes>

</

igChart:XamWebChart>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

igChart:XamWebChart x:Name ="chart">

<

igChart:XamWebChart.Background>

<

SolidColorBrush Color="White"></SolidColorBrush >

</

igChart:XamWebChart.Background>

i created three series dynamically and added to this XamWebchart.

Series1 = new Series();
Series2= new Series();
Series3 = new Series();

Added DatapointsCollection to each series.

I want to show Multi series on the same Xamwebchart. I have a date control, when I select a different month in the date control, the data to the Xam web chart should change. the problem I am getting is, when I bind the second time the legends are appearing duplicated, how can I clear this. Is the solution each time I create a new instance of the XamWebChart in the code behind and show with out having a XamWebChart tag in the designer. Or else have the tag in the designer and in the code behind create another new instance of the XamWebchart in the code behind with the same primaryY, PrimaryX axis and legends and then assign this instance to the XamWebchart tag.

i saw your post http://community.infragistics.com/forums/p/18376/66768.aspx#66768 but in that "xAxis.AxisType = AxisType.PrimaryX;" line is not compiling. Please suggest. Thanks for your help.

Thanks and regards,

Usha.

Parents
  • 26458
    Suggested Answer
    Offline posted

    If you intend to show 3 new series each time, make sure you're clearing the chart.Series collection. Try calling chart.Series.Clear() before you create new series. As for AxisType not being recognized, try adding:
    using Infragistics.Silverlight.Chart; to your page. If that doesn't help, please provide the error message.

Reply Children
No Data