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

RadCartesianChart odd behavior

1 Answer 55 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Kyle
Top achievements
Rank 1
Kyle asked on 24 Mar 2015, 01:43 PM
The chart in my app performs relatively well with exception to one odd behavior.

First, I am creating a point series manually.  I say manually meaning I am creating it point by point.  I do this using a PointTemplate so I can control the color of each point in the series.  The retrieval of data and the creation of each point in the series happens pretty quickly.  Less than 80 milliseconds on average.

Also on the window is a grid where when selecting a row the point series is drawn in the chart.  Clicking another row removes the previous point series and creates a new one.

If I start by clicking the first row and then hold down the down arrow, it draws the first 4 to 5 rows with ease and then seems to pause.  When it finally unpauses, it has "skipped" about 10 to 12 rows and from then on never pauses again.  I have verified in code that the data for the "skipped" rows is being loaded.  They series just aren't being rendered.

A few observations:
  1. When the chart is very small I do not experience this.  When the chart is larger I do.
  2. As I said, after the pause, it continues and then never pause again.  However if I move in the opposite direction in the grid it does pause.  But again after the pause it does not do it again.  Then going in the opposite direction again it does the same thing.

I have tried all the different RenderOptions available.​  I have also tried the RenderMode setter which is obsolete.  I have also tried not using a PointTemplate.

Are there other tweaks that can be done to resolve this?


<telerik:RadCartesianChart Name="Chart"
                           Grid.Column="0">
 
    <telerik:RadCartesianChart.Resources>
        <DataTemplate x:Key="PointSeriesTemplate">
            <Ellipse Fill="{Binding DataItem.Color, Converter={StaticResource ColorToBrushConverter}}" Width="3" Height="3"/>
        </DataTemplate>
    </telerik:RadCartesianChart.Resources>
 
    <telerik:RadCartesianChart.Behaviors>
        <telerik:ChartPanAndZoomBehavior/>
    </telerik:RadCartesianChart.Behaviors>
 
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:DateTimeCategoricalAxis DateTimeComponent="Minute"
                                         LabelFitMode="MultiLine"
                                         LabelFormat="H:mm"
                                         LineThickness="1"
                                         MajorTickInterval="60"
                                         MajorTickLength="5"
                                         TickThickness="1"/>
    </telerik:RadCartesianChart.HorizontalAxis>
 
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis LineThickness="1"
                            MajorTickLength="5"
                            TickThickness="1"
                            Title="Percent Change" />
    </telerik:RadCartesianChart.VerticalAxis>
 
    <telerik:RadCartesianChart.Grid>
        <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
    </telerik:RadCartesianChart.Grid>
 
    <telerik:RadCartesianChart.SeriesProvider>
        <telerik:ChartSeriesProvider Source="{Binding ChartData}">
            <telerik:ChartSeriesProvider.SeriesDescriptors >
 
                <telerik:CategoricalSeriesDescriptor ItemsSourcePath="ChartItems" ValuePath="YValue" CategoryPath="XValue">
                    <telerik:CategoricalSeriesDescriptor.Style >
                        <Style TargetType="telerik:PointSeries">
                            <Setter Property="PointTemplate" Value="{StaticResource PointSeriesTemplate}"/>
                            <Setter Property="RenderOptions">
                                <Setter.Value>
                                    <telerik:BitmapRenderOptions/>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </telerik:CategoricalSeriesDescriptor.Style>
                </telerik:CategoricalSeriesDescriptor>
 
            </telerik:ChartSeriesProvider.SeriesDescriptors>
        </telerik:ChartSeriesProvider>
    </telerik:RadCartesianChart.SeriesProvider>
 
</telerik:RadCartesianChart>

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 27 Mar 2015, 09:30 AM
Hi Kyle,

Thank you for the explanations and the attached xaml code. Unfortunately, I do not fully understand the issue at hand.

1. We are a little unsure what you mean by creating the series manually when you use a series provider at the same time. It is not clear to us whether you are working in bound or unbound mode.

2. We are unsure if you plot a single series at a time, or is it possible that when multiple rows are selected, multiple series to be added to the chart.

3. We understand that when you hold the down-arrow, the chart gets updated at first and that the behavior changes after that, but without a demo project to see what exactly is happening, we can only guess what happens and why. Perhaps you have changed the data before the chart had time to render, and this is why you do not see the old data plotted.

I will ask that you prepare a small project that demonstrates this, so that we can investigate.

Usually we suggest that you do not use point templates when you are dealing with large data and when performance is of the essence. You can use the DefaultVisualStyle to plug in a Style targetting a Path. You mentioned the need for a point to have a color from the DataItem, you can use a Setter in the style, targetting the Fill property and use a relative source Binding to its Tag, where the data point is contained. Light rendering, though, may not handle this binding, as it is light-rendering and has some limitations.

4. Can you tell us if you need a separate color for each item, or do you need a special coloring for only a few items?

Do send us a small project that we can run and we will do our best to assist you. This a public forum and you will not be able to attach anything other than an image, so you can either open a support ticket or you can attach the project in some storage provider and give us a link.

Regards,
Petar Marchev
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Chart
Asked by
Kyle
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or