PDA

View Full Version : Problem on 'integrating' TimeAxis and NumericAxis



alisyah
10 Nov 2010, 8:20 PM
Hello all,

Currently I'm working with linechart.
Now my xAxis is CategoryAxis, and the yAxis is NumericAxis.
But that xAxis should be TimeAxis to present better information.

I set minimum and maximum value for the NumericAxis (yAxis).
Those two values are working well as long as the xAxis is CategoryAxis, and when I change that xAxis from CategoryAxis to become TimeAxis, those two values won't work.

The following is working codes:

new Ext.Panel({
renderTo: 'container',
layout:'column',
height:400,
items: [{
xtype: 'linechart',
width: 850,
height: 350,
id: 'myChart2',
store: store,
url: '../../resources/charts.swf',
xField: 'date',
extraStyle: {
legend: {
display: 'top'
},
xAxis: {
labelRotation: -90
}
}, xAxis: new Ext.chart.CategoryAxis({
title: 'Date'
}),
yAxis: new Ext.chart.NumericAxis({
title: 'Val',
minimum: 1000,
maximum: 1012
}),


//rest codes come here



And the following codes are not working
for info: dateFrom and dateTo are variables

new Ext.Panel({
renderTo: 'container',
layout:'column',
height:400,
items: [{
xtype: 'linechart',
width: 850,
height: 350,
id: 'myChart2',
store: store,
url: '../../resources/charts.swf',
xField: 'date',
extraStyle: {
legend: {
display: 'top'
},
xAxis: {
labelRotation: -90
}
}, xAxis: new Ext.chart.TimeAxis({
title: 'Date',
labelRenderer: function(date)
{
return date.format("Y-M-d");
},
minimum: dateFrom,
maximum: dateTo,
}),
yAxis: new Ext.chart.NumericAxis({
title: 'Val',
minimum: 1000,
maximum: 1012
}),


//rest codes come here


Anyone has explanation or suggestion what to add or remove to get them work back?

Thanks,
Alisyah.

Niugeo
2 Dec 2010, 3:33 AM
Dear Alisyah it's the second time that we "share" the same problem. :-)
I'm working with timeAxix with two yAxis(with two different scale)over it, but minimum or maximum option doesn't work.
Any explanation please??