arrow_back
Back

Apache ECharts: bar charts, options, and series data

Andrew Dorokhov Andrew Dorokhov schedule 1 min read
menu_book Table of Contents

Homepage: open_in_new echarts.apache.org .

Example

const profitGraph = echarts.init(document.getElementById('profit-graph'));

const option = {
    tooltip: {},
    legend: {
        data: ['Sales']
    },
    xAxis: {
        data: ['shirt', 'cardigan', 'chiffon shirt', 'pants', 'heels', 'socks']
    },
    yAxis: {},
    series: [{
        name: 'Sales',
        type: 'bar',
        data: [5, 20, 36, 10, 10, 20]
    }]
};

profitGraph.setOption(option);

Options

Full option reference: open_in_new echarts.apache.org/en/option.html .

  • legend — which series appear in the legend (count and names).
  • series — main data property: the list of series / points. For coordinate charts, values map to the axes (x then y depending on series type).
code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward