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

CustomLine repeats across RadChart

1 Answer 22 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Willem
Top achievements
Rank 1
Willem asked on 28 Nov 2012, 06:05 AM

When using the CustomLine drawn using RadChart annotations we are experiencing an issue if the slope of the line is very small and intercepts with the visible y-axis. 

The line will either repeat many times across the chart or disappear entirely.

To reproduce this issue please modify the sample from http://www.telerik.com/community/forums/silverlight/chart/annotation-text-on-customline.aspx  with the following sample data and line definition

MainPage.xaml.cs

dataCollection.Add(new DummyDataItem {XValue = 1, YValue = 0.02 });
dataCollection.Add(new DummyDataItem { XValue = 2, YValue = 0.01873752 });
dataCollection.Add(new DummyDataItem { XValue = 3, YValue = 0.01813006 });
dataCollection.Add(new DummyDataItem { XValue = 4, YValue = 0.01697080 });
dataCollection.Add(new DummyDataItem { XValue = 5, YValue = 0.01771891 });
dataCollection.Add(new DummyDataItem { XValue = 6, YValue = 0.01513730 });
dataCollection.Add(new DummyDataItem { XValue = 7, YValue = 0.01590351 });
dataCollection.Add(new DummyDataItem { XValue = 8, YValue = 0.01746018 });
dataCollection.Add(new DummyDataItem { XValue = 9, YValue = 0.01691618 });
dataCollection.Add(new DummyDataItem { XValue = 10, YValue = 0.01466685 });
dataCollection.Add(new DummyDataItem { XValue = 11, YValue = 0.01528516 });
dataCollection.Add(new DummyDataItem { XValue = 12, YValue = 0.01634741 });
dataCollection.Add(new DummyDataItem { XValue = 13, YValue = 0.01529021 });

MainPage.xaml

<telerik:CustomLine Style="{StaticResource gridLineStyle}"
                    DataContext="Test" Stroke="Red" Slope="0.0000030000000000001089" YIntercept="0.019997" />

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 30 Nov 2012, 05:10 PM
Hi Willem,

This kind of behavior is caused by a well-known limitation in Silverlight - Silverlight uses a 16-bit integer to calculate sizes. In your case, the CustomLine is rendered with a size greater than the max value of Int16 and this causes Silverlight to render it in multiple rows. As a work around, I can suggest that you set the line's Slope property to 0.

All the best,
Ivan N.
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart
Asked by
Willem
Top achievements
Rank 1
Answers by
Missing User
Share this question
or