What is wrong with this chart?

I have the following code to make the chart. But the graph display wrong. Here is the code Ext.onReady(function(){ Ext.define('FinancialRatio',{ extend: 'Ext.data.Model', fields: ['year','revenue'] }); var FinancialRatioStore = Ext.create('Ext.data.Store',{ model: 'FinancialRatio', autoLoad:true, proxy:{ type: 'ajax', url: 'http://localhost/FinancialRatio.php', reader:{ type: 'xml', record: 'ratio' } } }); var revenue = Ext.create('Ext.Window',{ width: 400, height:300, renderTo: Ext.getBody(), hidden: false, maximizable: true, title: 'Revenue', layout: 'fit', items:{ xtype: 'chart', style: 'background:#fff', store: FinancialRatioStore, animate: true, axes:[{ title: 'Revenue', type: 'Numeric', position: 'left', fields: ['revenue'] },{ title: 'Year', type: 'Category', position: 'bottom', fields: ['year'] }], series:[{ type: 'line', xField: 'year', yField: 'revenue' }] } }); And here is the result ![enter image description here][1] [1]: http://i.stack.imgur.com/3shqD.png But the actual data is as follow (I wrote the grid code to display this data) ![enter image description here][2] [2]: http://i.stack.imgur.com/weBzl.png Base on the data, the graph is displaying wrong. But I cant figure out where I did wrong. Could you please help me out? Also, what is the differences between the "fields" in axes and the "xfield" and "yfield" in series? Thank you

以上就是What is wrong with this chart?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏