echarts折線圖的每個折點都顯示數值


在 series中添加

itemStyle : { normal: {label : {show: true}}}
1
在django中使用echarts折線圖的完整代碼

<script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
option = null;

result = eval({{ chart_data | safe }});

option = {
title: {
text: result.title,
x: 'center',
show : true
},
tooltip: {
formatter: '{b}\n{c}'
},
xAxis: {
type: 'category',
data: result.feature
},
yAxis: {
type: 'value'
},
series: [{
data: result.data,
type: 'line',
// 顯示數值
itemStyle : { normal: {label : {show: true}}}
}]

};


if (option && typeof option === "object") {
myChart.setOption(option, true);
}
</script>
————————————————


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM