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

SplineSeriesDefinition Drawing

1 Answer 42 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Joel Palmer
Top achievements
Rank 2
Joel Palmer asked on 15 Feb 2011, 08:41 PM
I have a chart as defined below.  I get a TrendCollection, which is an Observable collection also defined below:

This trend is supposed to display hourly data of one Tag.  When I display 7 days worth of data (Collection of 168 values)
 the chart acts badly.  The lines don't connect to each other and large gaps in the lines are there which makes the line useless.
When I display 5 days worth (120 values), it displays correctly.  Am I expecting too much of this control? 
Shouldn't it be able to handle this number of values?

I have attached pictures of the 7 day and of the 5 day.

private ObservableCollection<TagHistoryDD> _trendCollection =
    new ObservableCollection<TagHistoryDD>();
public ObservableCollection<TagHistoryDD> TrendCollection
{
    get { return _trendCollection; }
    set 
    
        _trendCollection = value;
        NotifyPropertyChanged("TrendCollection");
    }
}



<
telerik:RadChart x:Name="chart" 
    Grid.Row="3" Margin="10,0,0,0"
    ItemsSource="{Binding TrendCollection}">
    <telerik:RadChart.SeriesMappings>
        <telerik:SeriesMapping>
            <telerik:SeriesMapping.SeriesDefinition>
                <telerik:SplineSeriesDefinition 
                    ShowItemLabels="False"
                    ShowPointMarks="False">
                </telerik:SplineSeriesDefinition>
            </telerik:SeriesMapping.SeriesDefinition>
            <telerik:SeriesMapping.GroupingSettings>
                <telerik:GroupingSettings>
                    <telerik:GroupingSettings.GroupDescriptors>
                        <telerik:ChartDayGroupDescriptor
                            Member="Timestamp" />
                    </telerik:GroupingSettings.GroupDescriptors>
                </telerik:GroupingSettings>
            </telerik:SeriesMapping.GroupingSettings>
            <telerik:SeriesMapping.ItemMappings>
                <telerik:ItemMapping FieldName="Timestamp"
                       DataPointMember="XValue"  />
                <telerik:ItemMapping FieldName="Value"
                       DataPointMember="YValue" />
            </telerik:SeriesMapping.ItemMappings>
        </telerik:SeriesMapping>
    </telerik:RadChart.SeriesMappings>
    <telerik:RadChart.DefaultView>
        <telerik:ChartDefaultView>
            <telerik:ChartDefaultView.ChartArea>
                <telerik:ChartArea FlowDirection="LeftToRight" >
                    <telerik:ChartArea.AxisX>
                        <telerik:AxisX IsDateTime="True"
                              LabelStep="1"
                              LabelRotationAngle="20"
                              DefaultLabelFormat="dd-MMM"
                              StepLabelLevelHeight="10">
                        </telerik:AxisX>
                    </telerik:ChartArea.AxisX>
                    <telerik:ChartArea.AxisY>
                        <telerik:AxisY 
                            AutoRange="False" 
                            MaxValue="100"
                            MinValue="0"
                            Step="25"
                            AxisLabelsVisibility="Visible"
                            MajorGridLinesVisibility="Visible"
                            MinorGridLinesVisibility="Collapsed"
                            />
                    </telerik:ChartArea.AxisY>
                </telerik:ChartArea>
            </telerik:ChartDefaultView.ChartArea>
        </telerik:ChartDefaultView>
    </telerik:RadChart.DefaultView>
</telerik:RadChart>

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 18 Feb 2011, 11:12 AM
Hi Joel,

I created a small example, based on the code provided and it worked correctly for me. You can find it attached along with a screenshot. Please, give it a try and let me know if I have missed anything.

Best regards,
Ves
the Telerik team
Tags
Chart
Asked by
Joel Palmer
Top achievements
Rank 2
Answers by
Ves
Telerik team
Share this question
or