Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ECharts Tutorial

ECharts Tutorial

ECharts is an open-source visualization library implemented in JavaScript, covering charts across industries and meeting various needs.

ECharts provides rich chart types and interaction capabilities, enabling users to generate various charts through simple configuration, including but not limited to line charts, bar charts, scatter charts, pie charts, radar charts, maps, and more.

ECharts follows the Apache-2.0 open-source license and is free for commercial use.

ECharts is compatible with the vast majority of current browsers (IE8/9/10/11, Chrome, Firefox, Safari, etc.) and various devices, allowing display anytime and anywhere.

Knowledge you need before reading this tutorial:

To read this tutorial, you need to have the following foundation:

First ECharts Example

Example

<

!

DOCTYPE

html

<

html

<

head

<

meta

charset

=

"

utf-8

"

<

title

First ECharts Example

title

<

script

src

=

"

https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js

"

script

head

<

body

<

div

id

=

"

main

"

style

=

"

width: 600px;height:400px;

"

div

<

script

type

=

"

text/javascript

"

// Initialize the echarts instance based on the prepared DOM var myChart = echarts.init(document.getElementById('main')); // Specify the chart's configuration and data var option = { title: { text: 'First ECharts Example' }, tooltip: {}, legend: { data:['Sales'] }, xAxis: { data: ["Shirt","Sweater","Chiffon Shirt","Pants","High Heels","Socks"] }, yAxis: {}, series: [{ name: 'Sales', type: 'bar', data: [5, 20, 36, 10, 10, 20] }] }; // Display the chart using the just-specified configuration and data. myChart.setOption(option);

script

body

html

Try it »

Click the "Try it" button to view the online example

ECharts Features

ECharts includes the following features: