凌益与零 2013-12-05 02:00
浏览 2775

extjs如何把折线图chart放入到panel中进行显示

Ext.onReady(function() { //创建每月贴现价格统计图 //通过JSON从数据库中获取数据 var chartStore = Ext.create('Ext.data.JsonStore', { fields : [ 'date', 'price1', 'price2', 'price3', 'price4' ], proxy : { type : 'ajax', url : 'chartSearch', reader : { type : 'json' } } }); //四条按交易类别区分的统计线 var monthPriceChart=Ext.create('Ext.chart.Chart', { id:'monthPriceChartid', animate: true, /* renderTo:'LineChart', */ width: 500, height: 300, store : chartStore, axes : [ {//定义坐标轴 title : 'Price', //纵轴标题 type : 'Numeric', position : 'left', fields : [ 'price1','price2','price3','price4'], grid:true, minimum:0 }, { title : 'Day', type : 'Category', position : 'bottom', fields : [ 'date' ] } ], series : [ { type : 'line', highlight:{ size:7, radius:7 }, displayName : '小票买断价', xField : 'date', yField : 'price1', markerConfig:{ type:'cross', size:4, radius:4, 'stroke-width':0 }, style : { color : 0xCCFF00 } }, { type : 'line', highlight:{ size:7, radius:7 }, displayName : '大票买断价', xField : 'date', yField : 'price2', markerConfig:{ type:'circle', size:4, radius:4, 'stroke-width':0 }, style : { color : 0xCC0000 } }, { type : 'line', highlight:{ size:7, radius:7 }, displayName : '当天出款价', xField : 'date', yField : 'price3', markerConfig:{ type:'cross', size:4, radius:4, 'stroke-width':0 }, style : { color : 0x0033FF } }, { type : 'line', highlight:{ size:7, radius:7 }, displayName : '带票价', xField : 'date', yField : 'price4', markerConfig:{ type:'circle', size:4, radius:4, 'stroke-width':0 }, style : { color : 0x66CC00 } } ] }); //创建一个panel var chartPanel = Ext.create('Ext.panel.Panel', { id:'chartPanel', renderTo : Ext.getBody(), title : '价格统计图', layout:'border', border : false, autoScroll:true, tbar : [ '时间', { xtype : 'combo', format : 'Y-M',//显示类型 name : 'month', id : 'month', store : [ '2013-07', '2013-08', '2013-09', '2013-10', '2013-11', '2013-12', '2014-01' ], emptyText : '2013-12', editable : false }, '银行类别:', { xtype : 'combo', name : 'bankType', id : 'bankSearch', store : [ '国股', '北上南宁', '省会城商', '全国城商', '外资', '农商农合', '信用社村镇' ], emptyText : '国股', editable : false }, '-', { text : '查询', handler : function() { chartStore.load({ params : { 'month' : Ext.getCmp('month').getValue(), 'bankType' : Ext.getCmp('bankSearch') .getValue() } }); } } ] }); chartStore.load({ params : { 'month' : '2013-12', 'bankType' : '国股' } }); })

以上是我的页面代码,如何使得折线图chart能够放入到panel中进行显示,我用的是extjs4-2-1版本,求详细解答,谢谢

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器