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

Sampling with DateTime in the XAxis

1 Answer 141 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.
Dunya
Top achievements
Rank 1
Dunya asked on 04 May 2012, 07:48 AM
Hello,

I am trying to draw a graph with possibly many thousands of data points, bound using the SeriesMapping/ItemMapping method. Both axes are bound as Value type data points (XValue & YValue).

My problem is that when sampling is turned on, my X axis displays values beginning from 0 in DateTime (31.12.1899, 1.1.1900... etc). When I turn off sampling (or zoom in enough that there are less data points than the sampling threshold), the graph draws just fine with tooltips etc working perfectly, but when it is turned on, the X axis values and tooltips are broken. The data points show up where they should though.

I've tried setting IsDateTime on and off (which should only be necessary for DataPoint binding anyway, according to the docs). IsZeroBased for XAxis is set to false as well. I also tried setting the AxisX.MinValue and MaxValue properties manually (which I believe shouldn't work when AutoRange isn't set to false) to no avail.

Any solutions?

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 08 May 2012, 09:25 AM
Hi Dunya,

1. X axis displays values beginning from 0 in DateTime
I was not able to reproduce this. I created a simple project and it plots the dates correctly. I have attached the project to this post (also included a snapshot of the output, look for attachment XAxisSampleDateTime1), so that you can test it and see if you get the same results. If you get correct results with the sample project I have provided and errenous results with your project I suggest that you compare the code to find the differences and hopefully discover what causes the incorrect labels' text.

When data is sampled a few data items are clustered (summarized) into a single data point. This is the reason the DataItem of the data point is null, which results in invalid tooltips. I can suggest that you use the Custom Sampling Functions to be able to show proper information in the tool tips. I have also attached a project that demonstrates this(attachment CustomSamplingFunctionsAndToolTips) to get you started.

I hope the above is of help.  

Greetings,
Petar Marchev
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

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