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

enn-charts-vue3

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enn-charts-vue3

enn-charts-vue3

0.1.0
latest
npmnpm
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

enn-chart-vue3

npm 地址

gitlab 地址

依赖

  • echarts5.2.2

使用步骤

安装依赖,yarn add enn-charts-vue3/npm i enn-charts-vue3

使用例子

<template>
  <div class="chart" ref="chartRef"></div>
</template>
<script setup>
import echarts, { getOptions, getLoadingOption } from "enn-charts-vue3";
import { onMounted } from 'vue3'

const chartRef = ref(null); // chart对于dom
let myChart = null; // chart实例
onMounted(() => {
  myChart = echarts.init(chartRef.value);
  const option = getOptions()
  option.xAxis.data = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
  option.series[0].data = [1, 2, 3, 4, 5, 6, 7]
  myChart.setOption(option);
});
</script>

<style scoped>
.chart {
  width: 500px;
  height: 400px;
}
</style>

getOptions 说明

  • 入参(type = 'line', dataNum = 1).
    • 第一个参数为组件类型【line/pie/bar】,第二个为数据量
  • 出参
    • 返回一个有默认值的echarts option,需要手动去修改里面的data以及横轴纵轴等

Keywords

enn

FAQs

Package last updated on 01 Dec 2022

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