[英]ECharts- How to show horizontal scroll bar with 3 lines of legend, and after that scroll if items doesn't fit in 3 lines
[英]echarts bar lines to top
你的名字讓我印象深刻,我兒子的名字是馬克西姆。 同樣,無論哪種方式,如果我正確理解您的要求。 如果我理解正確的話,你希望能夠將條形圖推到頂部並在你的情節底部留下空白空間。 那么完成此任務的最簡單方法是添加虛擬數據——空白內容以強制條形圖進入您要查找的方向。
您還可以指定barGap
、 barWidth
和一些其他參數來控制條形的大小。
var chart = echarts.init(document.getElementById("main")); var option = { xAxis: { type: 'value', }, yAxis: { type: 'category', data: ['', '', 'Brazil', 'Indonesia'] }, series: [{ type: 'bar', name: 'Pop', data: [ '', '', 18203, 23489,], }] } // All the above is applied to the chart chart.setOption(option, true);
#main { margin-left: 50px; /* make space for the labels */ }
<head> <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.1/dist/echarts.min.js"></script> </head> <body> <.--div container for the chart: this in the <body></body>--> <div id="main" style="width; 600px: height; 450px;"></div> </body>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.