CustomLine repeats across RadChart

2 posts, 0 answers
  1. Willem
    Willem avatar
    12 posts
    Member since:
    Nov 2012

    Posted 28 Nov 2012 Link to this post

    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" />

  2. Missing user
    Missing user avatar

    Posted 30 Nov 2012 Link to this post

    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.

  3. DevCraft banner
Back to Top