-
6 Dec 2012 1:28 AM #1Sencha User
- Join Date
- Feb 2012
- Location
- Mülheim an der Ruhr, Germany
- Posts
- 64
- Vote Rating
- 0
- Answers
- 3
Unanswered: Time axis in line chart
Unanswered: Time axis in line chart
Hi,
i have an problem in updating from ext 4.0 to ext 4.1.1a.
In a line chart is not displayed the bottom time axis
in ext 4.0 works it perfect:
here is a part of the store:
here the chart:Code:[{'id':20,'sprenger':357,'ba':347,'sopart':402,'datum':'2011-09-15'}, {'id':21,'sprenger':200,'ba':211,'sopart':242,'datum':'2011-10-13'}, {'id':22,'sprenger':205,'ba':196,'sopart':250,'datum':'2011-11-15'}, {'id':23,'sprenger':159,'ba':150,'sopart':186,'datum':'2011-12-15'},
I can't use fromDate, because i don't know when the time axis must start.Code:var dia = Ext.create ('Ext.chart.Chart', { xtype: 'chart', id: 'chartCmp', width: 800, height: 450, store: mystore334, legend: { position: 'right' }, axes: [ { title: 'Anzahl', type: 'Numeric', position: 'left', fields: ['sprenger','ba','sopart'], grid: true, } , { title: 'Meldemonat', type: 'time', position: 'bottom', fields: ['datum'], dateFormat:'m.Y', grid: true, label: { rotate: { degrees: 270 } } } ], series: [ { type: 'line', axis: 'left', xField: 'datum', yField: 'sprenger', tips: { trackMouse: true, width: 40, height: 25, renderer: function(storeItem, item) { this.setTitle(storeItem.get('sprenger')); }} }, { type: 'line', axis: 'left', xField: 'datum', yField: 'ba', fill: true, highlight: { size: 7, radius: 7 }, tips: { trackMouse: true, width: 40, height: 25, renderer: function(storeItem, item) { this.setTitle(storeItem.get('ba')); }} }, { type: 'line', axis: 'left', xField: 'datum', yField: 'sopart', tips: { trackMouse: true, width: 40, height: 25, renderer: function(storeItem, item) { this.setTitle(storeItem.get('sopart')); }} } ] });
In bottom line he displayed me Nan.0NaN. The load time is much longer, or the browser wants to abort the script. When he loads the store, the browser also displayed Nan.0NaN.
I search in the forum, but i only find the hint with fromDate. When i use fromDate (for test) then he loads very long and displayed the lines right, but the bottom line is always wrong.
Someone an idea?
-
8 Dec 2012 6:24 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
Using this code I see both axis:
Looking like there is an error in 4.1.1 showing the dates in the bottom axis which looks to be fixed in 4.1.3Code:Ext.create('Ext.chart.Chart', { xtype : 'chart', renderTo : document.body, width : 800, height : 450, store : { fields : ['id', 'sprenger', 'ba', 'sopart', { name : 'datum', type : 'date', dateFormat : 'Y-m-d' } ], data : [ {'id' : 20, 'sprenger' : 357, 'ba' : 347, 'sopart' : 402, 'datum' : '2011-09-15'}, {'id' : 21, 'sprenger' : 200, 'ba' : 211, 'sopart' : 242, 'datum' : '2011-10-13'}, {'id' : 22, 'sprenger' : 205, 'ba' : 196, 'sopart' : 250, 'datum' : '2011-11-15'}, {'id' : 23, 'sprenger' : 159, 'ba' : 150, 'sopart' : 186, 'datum' : '2011-12-15'} ] }, legend : { position : 'right' }, axes : [ { title : 'Anzahl', type : 'Numeric', position : 'left', fields : ['sprenger', 'ba', 'sopart'], grid : true }, { title : 'Meldemonat', type : 'time', position : 'bottom', fields : ['datum'], dateFormat : 'm.Y', grid : true, label : { rotate : { degrees : 270 } } } ], series : [ { type : 'line', axis : 'left', xField : 'datum', yField : 'sprenger', tips : { trackMouse : true, width : 40, height : 25, renderer : function (storeItem, item) { this.setTitle(storeItem.get('sprenger')); }} }, { type : 'line', axis : 'left', xField : 'datum', yField : 'ba', fill : true, highlight : { size : 7, radius : 7 }, tips : { trackMouse : true, width : 40, height : 25, renderer : function (storeItem, item) { this.setTitle(storeItem.get('ba')); }} }, { type : 'line', axis : 'left', xField : 'datum', yField : 'sopart', tips : { trackMouse : true, width : 40, height : 25, renderer : function (storeItem, item) { this.setTitle(storeItem.get('sopart')); } } } ] });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote