PDA

View Full Version : Ext.chart.Chart doesn't display correct chart with date field



AndreyPris
27 Nov 2014, 4:55 AM
Can you help me with chart. Don't display correct chart with date field.


Ext.define('Ext.view.chart.hotelInfo', {
extend: 'Ext.chart.Chart',
requires: [
'Ext.util.Point',
'Ext.chart.series.Line',
'Ext.chart.axis.Category',
'Ext.chart.axis.Numeric'
],
alias: 'widget.hotelInfo',
store: 'floston.store.chart.hotelStore',
axes: [
{
type: 'Numeric',
position: 'left',
fields: 'count',
grid : true,
minimum : 0,
maximum: 25
},
{
type: 'Category',
position: 'bottom',
fields: ['startDate']
}
],
series: [
{
type: 'line',
highlight: {
size: 4,
radius: 4
},
axis: 'left',
xField: 'count',
yField: ['startDate'],
markerConfig: {
type: 'cross',
size: 3,
radius: 3,
'stroke-width': 0
},
tips: {
trackMouse: true,
width: 150,
height: 28,
renderer: function (record, item) {
this.setTitle(record.get('startDate') + ': '
+ record.get('count') + ' orders.');
}
}
}
]
});


here is part of my json:


{
"data": [
{
"id": "29551",
"startDate": "2014-10-28",
"count": "12"
},
{
"id": "29563",
"startDate": "2014-10-29",
"count": "14"
},
{
"id": "29577",
"startDate": "2014-10-30",
"count": "16"
},
{
"id": "29593",
"startDate": "2014-10-31",
"count": "12"
}]51118

lumberjack
1 Dec 2014, 1:56 PM
See if the following example will get you started on the right path.

Thanks,
Brian

e9j