NGINX社区官方微服务训练营,深入了解K8s网络,线上课程+专家答疑,立即加入>>>
使用echarts或是highcharts怎么实现如下的功能?
有没有demo或者思路也好。
刚接触echarts。。。
NGINX社区官方微服务训练营,深入了解K8s网络,线上课程+专家答疑,立即加入>>>
使用echarts或是highcharts怎么实现如下的功能?
有没有demo或者思路也好。
刚接触echarts。。。
Highcharts demo:http://www.hcharts.cn/demo/highcharts/column-basic
js代码:
$(function () {
$('#container').highcharts({
chart: {
type: 'column' //t图表类型
},
title: {
text: '手机年均销量对比图'//标题
},
subtitle: {
text: 'Source: WorldClimate.com' //副标题
},
xAxis: {
categories: [//X轴坐标值
'苹果',
'三星',
],
crosshair: true
},
yAxis: {
min: 0,
title: {
text: '销量 (万台)'
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y:.1f} 万台</b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [{
name: '2010',
data: [49.9, 71.5]
}, {
name: '2011',
data: [83.6, 78.8]
}, {
name: '2012',
data: [48.9, 38.8]
}, {
name: '2013',
data: [42.4, 33.2]
}]
});
});
demo: