APACHE ECHARTS

Apache ECharts, also known as Apache ECharts (incubating), is an open-source data visualization and charting library for web applications.

Prerequisites

Before you get started, ensure that you have the following prerequisites installed on your system:

Installation

npm install echarts

Install ECharts package from the npm registry to project's node_modules directory, and make it available for use in JavaScript code.

Define Chart Container

In Vue 3 component's template section, create a div element that will serve as the container for ECharts chart.

There are two ways to define the container:

$refs method

<div ref="echartsContainer" style="width: 100%; height: 300px;"></div>

Element ID method

Access chart container

after define the container, you can now access the container in<script>

There are two ways to access chart container:

$refs method

Element ID method

Initialize an ECharts instance

Using echarts.init() method to initialize the ECharts instance and bind it to a DOM element

Define and Set the Chart Options

Examples of ECharts Usage

Example 1 : Stacked Line Chart

Stack Line Chart of Four Sample Area's Temperature Data

Example 2: Pie Chart

Pie Chart of Number of Stirpot Ordered

Example 3: Bar Chart

Bar Chart of Number of Regenerative Drying Drum Ordered

Last updated