Runtime Error with CustomGridLine

2 posts, 0 answers
  1. müller
    müller avatar
    3 posts
    Member since:
    Aug 2010

    Posted 02 Dec 2011 Link to this post

    I get a runtime error if i do somthing like this:
    <chart:RadChart x:Name="RadChart1"
                   <charting:ChartDefaultView ChartLegendPosition="Top"
                           <charting:ChartLegend x:Name="PrimaryLegend" Header="Click on country to hide/show:" LegendItemMarkerShape="Square"  Foreground="Black" HeaderFontWeight="Normal" FontFamily="Segoe UI" /> 
                           <charting:ChartArea Padding="5,10,20,5" LabelFormatBehavior="None" LegendName="PrimaryLegend"
                                   <charting:CustomGridLine YIntercept="3"
                                   <charting:AxisY ExtendDirection="None"  /> 
                                   <charting:DataSeries LegendLabel="EU-27"
                                           <charting:LineSeriesDefinition ItemLabelFormat="0.#"
                                                   <charting:LabelSettings ShowConnectors="True" /> 
                                       <charting:DataPoint YValue="0" XValue="1998" /> 
                                       <charting:DataPoint YValue="0" XValue="1999" /> 
  2. Nikolay
    Nikolay avatar
    397 posts

    Posted 07 Dec 2011 Link to this post

    Hello Müller,

    The error is caused because you only have '0' values, but the Y interception line is drawn at a higher Y axis value. In such a scenario the best approach would be to set the YAxis AutoRange property to false and define a manual range. You can do this initially or on ItemDataBound event when having only 0 values.

    Best wishes,
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top