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

RadCartesianChart chart fails to draw the chart

3 Answers 100 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mahender
Top achievements
Rank 1
Mahender asked on 28 Dec 2012, 10:31 PM
I am using below chart with xaml definition:
<telerikChart:RadCartesianChart  x:Name="radChart" Margin="0,0,19,51">                 <telerikChart:RadCartesianChart.Grid>                     <telerikChart:CartesianChartGrid MajorLinesVisibility="Y" TextOptions.TextHintingMode="Animated"/>                 </telerikChart:RadCartesianChart.Grid>                 <telerikChart:RadCartesianChart.Behaviors>                     <telerikChart:ChartPanAndZoomBehavior ZoomMode="Horizontal" PanMode="Horizontal"/>                     <telerikChart:ChartTrackBallBehavior ShowTrackInfo="True" ShowIntersectionPoints="True" TrackInfoUpdated="ChartTrackBallBehavior_TrackInfoUpdated_1"/>                 </telerikChart:RadCartesianChart.Behaviors>                 <telerikChart:RadCartesianChart.HorizontalAxis >                     <telerikChart:DateTimeContinuousAxis                          LabelFormat="H:mm&#x000A;dd-MMM"                          LabelInterval="6"                          LabelFitMode="MultiLine"                          ZIndex="1">                         <telerikChart:DateTimeContinuousAxis.MajorTickStyle>                             <Style TargetType="Rectangle">                                 <Setter Property="Fill" Value="#666666"/>                                 <Setter Property="Margin" Value="0, -3, 0, 0"/>                             </Style>                         </telerikChart:DateTimeContinuousAxis.MajorTickStyle>                     </telerikChart:DateTimeContinuousAxis>                 </telerikChart:RadCartesianChart.HorizontalAxis>                 <telerikChart:RadCartesianChart.VerticalAxis>                     <telerikChart:LinearAxis                     LineStroke="Transparent"                     Maximum="100"  >                     </telerikChart:LinearAxis>                 </telerikChart:RadCartesianChart.VerticalAxis>                 <telerikChart:AreaSeries CombineMode="Stack" Fill="{StaticResource PhoneAccentBrush}">                     <telerikChart:AreaSeries.TrackBallTemplate>                         <DataTemplate>                             <Ellipse Width="12" Height="12" Fill="{StaticResource Series1Brush}"/>                         </DataTemplate>                     </telerikChart:AreaSeries.TrackBallTemplate>                 </telerikChart:AreaSeries>             </telerikChart:RadCartesianChart>

CategoricalDataPoint point = new CategoricalDataPoint();                 
point.Category = dateValue;                 
point.Value = value;                 
barSeries.DataPoints.Add(point);

If I use below data to plot the graph, I don't see any chart

# date    value
12/21/2012 3:25:12 AM 210000
12/20/2012 3:25:12 AM 200000
12/16/2012 3:25:12 AM 193
12/15/2012 2:45:12 PM 292
12/15/2012 2:25:12 PM 92
12/15/2012 2:15:12 PM 91
12/15/2012 1:45:12 PM 90
12/15/2012 1:05:12 PM 89
12/15/2012 12:55:12 PM 100
12/15/2012 12:25:12 PM 100

In my chart definition, I did set 100 as maximum in chart. But in my data, if I get above data I don't see any chart displayed. But I can see the trackball if hover on the chart area. If I remove the first dataset value (i.e. value = 210000), I can see the chart.

3 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 02 Jan 2013, 01:55 PM
Hi Mahender,

Thank you for writing.
This is to be expected. Having points outside the min/max value range results in undefined behavior. You should either remove the Maximum restriction or filter your data so that it is inside the min/max value range.

Please write again if you have other questions.

Kind regards,
Victor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Mahender
Top achievements
Rank 1
answered on 02 Jan 2013, 07:01 PM
Hi Victor,

I agree on that, if data is outside of max/min range - it shouldn't plot the chart...but
if use below data, I can still see graph (note: max/min range is 0-100)

12/20/2012 3:25:12 AM 200000
12/16/2012 3:25:12 AM 193
12/15/2012 2:45:12 PM 292
12/15/2012 2:25:12 PM 92
12/15/2012 2:15:12 PM 91
12/15/2012 1:45:12 PM 90
12/15/2012 1:05:12 PM 89
12/15/2012 12:55:12 PM 100
12/15/2012 12:25:12 PM 100
0
Victor
Telerik team
answered on 03 Jan 2013, 08:26 AM
Hello Mahender,

Thanks for writing again.
Yes, this is what undefined behavior means. There is no guarantee that the chart will work when it has conflicting settings.

There are two things we could do on our side. Either throw an exception when we detect such conflicting conditions or simply disregard all data that is outside the min/max range. If we choose to disregard the data and draw the chart without the problematic data it might be argued that the chart might be more robust, however this way it will swallow a problem that is in your settings/data which will probably bite you later on.

Thanks for bringing this case to our attention. We will consider what to do in order to make the chart have more explicit behavior.

Please write again if you have other questions.

Regards,
Victor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
Chart
Asked by
Mahender
Top achievements
Rank 1
Answers by
Victor
Telerik team
Mahender
Top achievements
Rank 1
Share this question
or