You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP

svelte-echarts

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
s

svelte-echarts

Svelte component for Apache ECharts

1.0.0
latest
74

Supply Chain Security

100

Vulnerability

83

Quality

81

Maintenance

100

License

Version published
Weekly downloads
1.6K
-12.55%
Maintainers
1
Weekly downloads
 
Created
Issues
5

svelte-echarts

A simple Apache ECharts component for Svelte! Check out this demo.

💿 Installation

npm i -D svelte-echarts echarts

⌨️ Usage demo

<script>
  import { Chart } from 'svelte-echarts'

  import { init, use } from 'echarts/core'
  import { BarChart } from 'echarts/charts'
  import { GridComponent, TitleComponent } from 'echarts/components'
  import { CanvasRenderer } from 'echarts/renderers'

  // now with tree-shaking
  use([BarChart, GridComponent, CanvasRenderer, TitleComponent])

  let options = {
    title: {
      text: 'ECharts Example',
    },
    xAxis: {
      type: 'category',
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
    },
    yAxis: {
      type: 'value',
    },
    series: [
      {
        type: 'bar',
        data: [120, 200, 150, 80, 70, 110, 130],
      },
    ],
  }
</script>

<div class="app">
  <Chart {init} {options} />
</div>

<style>
  .app {
    width: 100vw;
    height: 100vh;
  }
</style>

FAQs

Package last updated on 25 Apr 2025

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