Grafana集成Echarts Grafana v4.1.x Echarts v4.0.x
自定义数据源部分的代码出自这位大神 https://github.com/Billiballa/dxc-echarts-panel
option = {
title : {
},
tooltip : {
trigger: 'item'
},
legend: {
orient: 'vertical',
left: 'left'
},
visualMap: {
min: 0,
max: 2000,
calculable: true,
color: ['red','orange','yellow','lightgreen','green']
},
series : [
{
type: 'map',
mapType: 'china',
hoverable: true,
roam:true,
itemStyle:{
normal:{label:{show:true}, areaColor: '#edf2f1'},
emphasis:{label:{show:true}, areaColor: '#06060f'}
},
mapLocation: {
y: "center",
x: "center",
height: "320"
},
label: {
normal: {
show: true
},
emphasis: {
show: true
}
},
data: ctrl.data
}
]
};
{"y": ["10", "100", "20", "12", "150"], "x": ["2018-01-01", "2018-01-02", "2018-01-03", "2018-01-04", "2018-01-05"]}
- 将本实例clone到你的plugins目录后重新启动grafana服务即可
- git clone https://github.com/heruihong/grafana-echarts-panel
- npm install
- grunt