Extjs柱状图

Extjs柱状图

new Ext.Panel({

iconCls : 'chart',// 样式

title : 'ExtJS.com Visits and Pageviews, 2007/2008 (复杂样式)',

frame : true,

renderTo : 'container', width : 500, height : 300, layout :'fit',

 items : {

                       xtype : 'columnchart',// 柱状图

                       store : json_store,

                         url : '../extjs/resources/charts.swf',

                        xField : 'name',// X轴显示的值

                         yAxis : new Ext.chart.NumericAxis({ displayName :'Visits',

                                                       labelRenderer : Ext.util.Format .numberRenderer('0,0') }),// Y 轴显示的值                      

                       tipRenderer : function(chart, record, index, series) {// tip渲染

                                                if (series.yField =='visits')

                                              { return Ext.util.Format.number( record.data.visits,'0,0') + ' visits in ' + record.data.name; }

                                           else {return Ext.util.Format.number( record.data.views,'0,0') + ' page views in '+ record.data.name; } },

chartStyle : { padding : 10, animationEnabled : true,// 是否支持动态数据变化

                       font : {// 图表整体字体name : 'Tahoma', color : 'silver', size : 11 },

                       border : { // color:'#3399FF',// size:1 },

                       background : { color : '#CCCCCC',// 背景颜色

                        alpha : 0.1 // 透明度 // image: // mode:stretch},

legend : {// 图例

                       display : "bottom", spacing : 2, padding : 5,

                       font : { name : 'Tahoma', color :'#3366FF', size : 12, bold : true} },

 dataTip : { // 鼠标经过,数据提示样式 padding : 5,// 提示内容与边框的距离border : { color : "#FF3333", size : 1 },background : { color : 0xDAE7F6,// 背景颜色透明度alpha : .8 // 背景颜色透明度 }, font : { name :'Tahoma', color : '#FF3300', size : 10, bold : true} },

xAxis : { // X 轴 color : 0x69aBc8, // X轴颜色

                       majorTicks : {// 大刻度值color : 0x69aBc8, length : 4 },

                        minorTicks : {// 小刻度值 color : 0x69aBc8, length : 2 },

                        majorGridLines : { size : 1, color : '#999999'}, // showLabels:false, labelDistance : 4 },

 yAxis : { color : 0x69aBc8, majorTicks : {// 大刻度值color : 0x69aBc8, length : 4 }, minorTicks : {// 小刻度值color : 0x69aBc8, length : 2 }, majorGridLines : { size : 1, color : '#999999'} } },

series : [{ type : 'column',// 柱状图

              displayName : '浏览数', yField : 'views',

               style : { // image : 'bar.gif', // mode : 'stretch', color : '#66CCFF'} },

               { type : 'column', // line displayName : '点击数', yField : 'visits', style : { color : '#FF3300'// lineAlpha:0.5,// lineColor:'#FF3300', // alpha:0.8,// size:10 } }] } });

 

 

 

转载自:http://xiejin2008.iteye.com/blog/660163



 

为了您的安全,请只打开来源可靠的网址

打开网站    取消

来自: http://hi.baidu.com/sxh1990/blog/item/d0f71c1b5cb5ce60dbb4bd16.html
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值