PDA

View Full Version : Problem with Chart Time Axis



narkom
12 Jan 2012, 2:43 AM
I have Line Chart with time axis (declaration is shown below):
..................................
{
type: "Time",
dateFormat: "d/m H:i",
position: "bottom",
fields: ["X"],
groupBy: 'year,month,day,hour,minute',
constrain: true,
fromDate: new Date('1/1/11'),
toDate: new Date('1/2/11'),


step: [Ext.Date.HOUR, 1]
}],
..........................................

The range for time axis changes by Ext.data.Store :


"load": function(me, records, successful, operation, Opts){
var chart = Ext.getCmp("chartCmp");
var timeAxis = chart.axes.get(1);
timeAxis.fromDate = me.data.first().get("X");
timeAxis.toDate = me.data.last().get("X");
chart.redraw();
}

Data model for chart declared like this:


Ext.define("rtChartData", {
extend: "Ext.data.Model",
fields: [
{name: "id", type: "int"},
{name: "Y", type: "int"},
{name: "X", type: "date"},
{name: "prelim", type: "string"},
{name: "label", type: "string"}
]
});



This code works perfectly in Chrome, but not in IE8 (time axis don't scaling). ExtJS version is 4.0.1.
How to fix this problem?!

Best regards!

mitchellsimoens
12 Jan 2012, 10:43 AM
Please post in the appropriate forum. I have moved this to the Ext JS 4 Q&A forum. Also, please wrap your code in the code tags.