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

echarts-for-react

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

echarts-for-react

Apache Echarts components for React.

  • 3.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
244K
decreased by-8.98%
Maintainers
1
Weekly downloads
 
Created

What is echarts-for-react?

echarts-for-react is a React wrapper for Apache ECharts, a powerful, interactive charting and visualization library. This package allows you to easily integrate ECharts into your React applications, providing a wide range of chart types and customization options.

What are echarts-for-react's main functionalities?

Basic Line Chart

This code demonstrates how to create a basic line chart using echarts-for-react. The chart displays data for each day of the week.

import React from 'react';
import ReactECharts from 'echarts-for-react';

const LineChart = () => {
  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'
      }
    ]
  };

  return <ReactECharts option={option} />;
};

export default LineChart;

Bar Chart

This code demonstrates how to create a bar chart using echarts-for-react. The chart displays data for each day of the week.

import React from 'react';
import ReactECharts from 'echarts-for-react';

const BarChart = () => {
  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'
      }
    ]
  };

  return <ReactECharts option={option} />;
};

export default BarChart;

Pie Chart

This code demonstrates how to create a pie chart using echarts-for-react. The chart displays data for different traffic sources.

import React from 'react';
import ReactECharts from 'echarts-for-react';

const PieChart = () => {
  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' }
        ]
      }
    ]
  };

  return <ReactECharts option={option} />;
};

export default PieChart;

Other packages similar to echarts-for-react

Keywords

FAQs

Package last updated on 29 Oct 2021

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