Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use jQuery plug-in echarts to realize the effect of multi-line chart

Shulou Source: shulou.com Published: 2022-06-01 02:39:35 09月11日 Update

This article mainly explains "how to use the jQuery plug-in echarts to achieve multi-line chart effect", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "how to use the jQuery plug-in echarts to achieve multi-line chart effect" bar!

1. Background of the question:

Design a line chart to show the sales volume of apples and bananas

2. Implementation code:

Echarts- multiline chart body,html {width: 99%; height:99%; font-family: "Microsoft Yahei"; font-size: 12px;} # someline {width:100%; height:99%;} $(document) .ready (function () {var chart = document.getElementById ("someline")) Var echart = echarts.init (chart) Var option = {title: {text: 'fruit sales'}, tooltip: {trigger: 'axis'}, legend: {data: [' Apple', 'banana']} Toolbox: {feature: {saveAsImage: {}}, grid: {left:'3%, right:'4%, bottom:'3%, containLabel: true} XAxis: [{type: 'category', boundaryGap: false, data: [' first quarter, 'second quarter,' third quarter, 'fourth quarter]}] YAxis: [{type:' value'}], series: [{name:' Apple', type:'line', stack: 'sales volume', areaStyle: {normal: {}}, data: [1270 6382, 2091, 1034]}, {name:' Banana', type:'line', stack: 'sales', areaStyle: {normal: {}}, data: [2270, 3456, 5432, 3423]}]} Echart.setOption (option);})

3. Realize the effect picture:

Thank you for reading, the above is the content of "how to use jQuery plug-in echarts to achieve multi-line chart effect". After the study of this article, I believe you have a deeper understanding of how to use jQuery plug-in echarts to achieve multi-line chart effect. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Diagrams effects plug-ins Apple Banana Learning content sales sales problems sales Q2 Code four Seasons that is ideas situations renderings articles more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Linux Redmi Microsoft Shulou Technology