标签:
最近看ext的东西,讲真,快把人看哭了,封装的太死,各种不灵活,写得心好累。直接贴代码吧
var panel = new Ext.Panel({ id:‘main-panel‘, baseCls:‘x-plain‘, layout:‘hbox‘, items:[{ html:‘<div id="container" style="width:90%;height:90%;"></div>‘, afterRender: function () { drawCharts(); }} ] });
function drawCharts(){ var options = { chart: { plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false, renderTo:‘container‘, type:‘column‘ }, legend: { layout: ‘vertical‘, align: ‘right‘, verticalAlign: ‘middle‘, borderWidth: 0 }, title: { text: ‘‘ }, tooltip: { pointFormat:{series.name}: <b>{point.percentage:.1f}%</b>‘ }, labels:{ items:[{ html:‘‘, style: { left:‘1px‘, top:‘1px‘, } }], style:{ color:‘red‘, fontSize:45, fontWeight:‘bold‘, zIndex:1000 } }, series: [{ name: ‘Browser share‘, data: [ [‘Firefox‘, 45.0], [‘IE‘, 26.8], { name: ‘Chrome‘, y: 12.8, sliced: true, selected: true }, [‘Safari‘, 8.5], [‘Opera‘, 6.2], [‘Others‘, 0.7] ] }] }; new Highcharts.Chart(options); }
最后效果如下
标签:
原文地址:http://www.cnblogs.com/-totoro/p/5365052.html