PDA

View Full Version : Simple problem with linechart



phpmaster
29 Apr 2010, 5:46 AM
Hi guys,

I'm not able to see the Y field render any values/scale in my linechart.

Here is my code:

<script>
Ext.onReady(function() {
Ext.chart.Chart.CHART_URL = '../ext-3.1.1/resources/charts.swf';

var store = new Ext.data.JsonStore({
url: 'http://10.199.28.165/intranet/code_finder/json_global_hits.php',
fields: ['date_name', 'hits'],
root: 'data',
autoLoad: true
});

new Ext.Panel({
title: 'Code finder usage',
renderTo: 'container',
width: 500,
height: 300,
layout: 'fit',

items: {
xtype: 'linechart',
yField: 'hits',
xField: 'date_name',
store: store
}
});
});
</script>

Here is the json output from the remote (intranet) script

{"data":[{"hits":"454","date_name":"Nov 09"},{"hits":"1815","date_name":"Dec 09"},{"hits":"1869","date_name":"Jan 10"},{"hits":"2849","date_name":"Feb 10"},{"hits":"4601","date_name":"Mar 10"},{"hits":"4042","date_name":"Apr 10"}]}

Can anyone please tell me the reason why I'm not getting any values in the Y scale (hits). I can use the hits in the x scale so I know the data is being read (I don't think it's a data issue...)

Cheers

Simon