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

Time series chart

2 Answers 480 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 23 Jan 2012, 08:45 PM
First off, I've been using the new chart (DataViz) tools for a week now.  They are awesome.

My question is two-fold:
1)  Is there a recommended way to show a time series chart that shows the relative time between data points?  If you use the line chart, the data points are the same distance apart regardless of the time span between the two data points.

From a visual perspective, I have been able produce what I need using the "scatterLine" series type.  I've accomplished this by converting my time values into their "ticks" representations.  However, that produces labels on the x-axis like "634629218399630000".

2) In the absence of an obvious way to do a time series, can I create a custom function (anonymous or otherwise) to format the x-axis labels--the "tick" values--to a more friendly date/time representation.

E.g.
xAxis: {
    labels: {
        format: myFormatFunction(tickValue) { return formattedString }
    }
}

2 Answers, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 24 Jan 2012, 09:19 AM
Hi,

The scatter line chart with value axis in ticks is probably the best approximation of a date axis that you can get from the current version of the chart. The labels can be formatted via a template that allows function calls as well:

labels: {
        template: "Text #= new Date(value).toDateString() # more text"
}



I hope this helps.

Regards,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Scott
Top achievements
Rank 1
answered on 24 Jan 2012, 05:34 PM
Yes, that is perfect.  Thanks!  Wasn't sure about all the possibilities with the "template" property.
Tags
Charts
Asked by
Scott
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Scott
Top achievements
Rank 1
Share this question
or