PDA

View Full Version : Ext Chart and how to use timeaxis



Nils-Fredrik
25 Aug 2009, 12:36 AM
Wrote a blogpost about how to use timeaxis and cartesian charts.

See http://aboutfrontend.com/2009/08/extjs-ext-chart-and-timeaxis/

Enjoy!

drew
1 Sep 2009, 8:18 PM
Thanks for that! I was wondering how to cover the time gap's in data.

Nils-Fredrik
2 Sep 2009, 1:33 AM
I am planning a follow up on the post. Anything special you are interested in getting covered?

maxigroovy
23 Sep 2009, 12:43 AM
Well, I have some problems with lots of data. When the data points are across multiple days.
I wonder how to set the format for the X-label. You use 'H' in your example. But that's not good enough when showing data across multiple days.
When I use a full date as formatting for the X-label. The chart shows 3 times a date (left, middle, right), but the chart looks not right.

Data from 2009-06-02 till 2009-06-05

chart shows empty places at the beginning and at the end. Also the dates are 1 day before and 1 day after the data defines:

...................line, line, line, line
2009-06-01 2009-06-03 2009-06-06

I'll try to add a screenshot later.

Nils-Fredrik
23 Sep 2009, 1:18 PM
@maxigroovy: simple JavaScript date format. You should read my post Ext Date format (http://aboutfrontend.com/2009/08/ext-date-demytified-and-iso-8601/).

The answer is quite simple:

xAxis: new Ext.chart.TimeAxis({
labelRenderer: function(date) { return date.format("d.H"); }
}),I have also updated the blogpost, you'll find more examples there (http://aboutfrontend.com/2009/08/extjs-ext-chart-and-timeaxis/).