This is a migrated thread and some comments may be shown as answers.

facing a lot of issues in silverlight line chart

3 Answers 112 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Rohit Banerjee
Top achievements
Rank 1
Rohit Banerjee asked on 24 Feb 2010, 09:01 PM

Hi,
 I was trying to work with silverlight line series and i am facing with the following issues:
1. I have 349 records in my list. I have 4 line series and i am trying to attach each one of them individually. But it is extremely slow and sometimes it hangs. I am not using any animation. Just at my xaml i have declared:

<telerikChart:RadChart x:Name="RadChart2" Background="Transparent" UseDefaultLayout="False" Grid.Row="1">
<telerikCharting:ChartArea x:Name="webChartHPI"
Margin="0,0,0,1"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
FontFamily="Calibri"
FontSize="10"
>
</telerikCharting:ChartArea>
</telerikChart:RadChart>

and my code says ( for each individual series):

foreach(xxx.myclass sr in e.Result)
{

DataPoint dataPoint = new DataPoint();
dataPoint.XValue = Convert.ToDouble(sr.Year);
dataPoint.YValue = Convert.ToDouble(sr.Percent);
mySeries.Add(dataPoint);

}

mySeries.Definition = new LineSeriesDefinition();
mySeries.Definition.ShowItemLabels = false;

 

mySeries.Definition.Appearance.Stroke = (new SolidColorBrush(Color.FromArgb(255, 252, 237, 64))) as Brush;

mySeries.Definition.Appearance.Fill = (new SolidColorBrush(Color.FromArgb(255, 252, 237, 64))) as Brush;

 

mySeries.LegendLabel = "CBSA Level HPI";

 

webChartHPI.DataSeries.Add(mySeries);

All series have 349 records with the same X axis but the Y axis varies

2. I am not able to display Legends. Do i have to put <telerikcharting: legends > separately to achive this? Also i want the legend to display on the top left of the chart like in excel but not able to do so.

3. My third problem is i am not able to display negative values in a line series. This chart is completely different from that mentioned in 1. It has some 200 values having both +ve and -ve values for Y axis. But it is not displaying the -ve region. The chart was not even displaying and was hanging my machine. But when i put 
loanChartControl.AxisY.AutoRange = false;

it started displaying but then again i think this stopped it from displaying the -ve axis.

4. My final problem is with the chart size. I cannot shrink the size of the chart. It is taking the entire cell space. Also does the values displayed in the x axis depend on the space it gets ? I am not able to reduce the line series thickness as well.

The version i am using is 2009.2.812.1030 for Telerik.Windows.Controls.Charting.

Please help.

3 Answers, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 01 Mar 2010, 06:06 PM
Hi Rohit Banerjee,

1.     First of all we would suggest you to upgrade your control libraries to the latest version available as there is a number of performance improvements added. We would also like to point your attention to this forum thread containing some useful tips about performance in RadChart.

2.     "I am not able to display Legends. Do i have to put <telerikcharting: legends > separately to achive this? Also i want the legend to display on the top left of the chart like in excel but not able to do so." - RadChart provides automatic chart layout including ChartLegend, but unfortunately this feature is turned off in your code. To turn it on you should either set the UseDefaultLayout property of RadChart to true or add manually a ChartLegend instance like shown in this example and this blog post.

3.     Upgrading to the latest binaries should fix the problem.

4.     "My final problem is with the chart size. I cannot shrink the size of the chart. It is taking the entire cell space" - with the upcoming Q1 release(expected in the midst of march) there will be a property that will allow you to reduce the size of the Pie chart.


Hope this helps.

Regards,
Velin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
ssawchenko
Top achievements
Rank 1
answered on 17 May 2010, 05:26 PM
I am using the trial download to test out the package and I am noticing the same issue.  I took the 100k+ samples example and I was trying to change it from using the ItemSource to using DataSeries (since in my case I will need multiple lines on the chart, I will need multiple series and thus cannot use the ItemSource method, correct)?  Doing this change causes the application to hang while generating the DataSeries; it is unusable this way. 

My question I guess is: does the trial download include these fixes you're talking about?  Or will I need to purchase before I can see the difference in performance?

Thank you!
0
Velin
Telerik team
answered on 20 May 2010, 03:27 PM
Hello shayla sawchenko,

That is a rather old forum post and things have changed since the time of writing.Your assumptions are not correct because you can have multiple line series with ItemsSource - please, have a look at these articles describing the possible way for populating RadChart with data. By the way, the only possible approach to have 100k+ points in the chart is when using ItemsSource and series mapping objects(described here).

Here is an excerpt from the code of the 100k+ records example demonstrating the SeriesMapping and ItemsSource approach.
SeriesMapping temperatureMapping = new SeriesMapping();
  LineSeriesDefinition lineDefinition = new LineSeriesDefinition();
  lineDefinition.ShowItemLabels = false;
  lineDefinition.ShowPointMarks = false;
  temperatureMapping.SeriesDefinition = lineDefinition;
  temperatureMapping.ItemMappings.Add(new ItemMapping("Date", DataPointMember.XValue));
  ItemMapping yItemMapping = new ItemMapping("Temperature", DataPointMember.YValue);
  yItemMapping.SamplingFunction = ChartSamplingFunction.Average;
  temperatureMapping.ItemMappings.Add(yItemMapping);
  temperatureMapping.LegendLabel = "Temperature";
  RadChart1.SeriesMappings.Add(temperatureMapping);


Sincerely yours,
Velin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Chart
Asked by
Rohit Banerjee
Top achievements
Rank 1
Answers by
Velin
Telerik team
ssawchenko
Top achievements
Rank 1
Share this question
or