Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

echarts

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

echarts

A powerful charting and visualization library for browser

  • 3.0.2-beta2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
750K
decreased by-19.37%
Maintainers
1
Weekly downloads
 
Created

What is echarts?

ECharts is a powerful, interactive charting and visualization library for browser environments. It provides a wide range of chart types and is highly customizable, making it suitable for complex data visualization needs.

What are echarts's main functionalities?

Line Chart

This code initializes a basic line chart with ECharts. It sets up the x-axis with categories representing days of the week and the y-axis with numerical values. The series data represents the values for each day.

const echarts = require('echarts');
const chart = echarts.init(document.getElementById('main'));
const option = {
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [{
    data: [150, 230, 224, 218, 135, 147, 260],
    type: 'line'
  }]
};
chart.setOption(option);

Bar Chart

This code initializes a basic bar chart with ECharts. Similar to the line chart, it sets up the x-axis with categories and the y-axis with numerical values. The series data represents the bar heights for each category.

const echarts = require('echarts');
const chart = echarts.init(document.getElementById('main'));
const option = {
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [{
    data: [120, 200, 150, 80, 70, 110, 130],
    type: 'bar'
  }]
};
chart.setOption(option);

Pie Chart

This code initializes a basic pie chart with ECharts. The series data represents different categories and their corresponding values, which are displayed as slices of the pie.

const echarts = require('echarts');
const chart = echarts.init(document.getElementById('main'));
const option = {
  series: [{
    type: 'pie',
    data: [
      { value: 1048, name: 'Search Engine' },
      { value: 735, name: 'Direct' },
      { value: 580, name: 'Email' },
      { value: 484, name: 'Union Ads' },
      { value: 300, name: 'Video Ads' }
    ]
  }]
};
chart.setOption(option);

Other packages similar to echarts

Keywords

FAQs

Package last updated on 27 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc