123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827 |
- import React, { useEffect, useRef, useState } from 'react'
- import * as echarts from 'echarts'
- import { EChartsOption, init, dispose, registerMap } from 'echarts'
- import { Empty } from 'antd'
- import { china } from '@/utils/dictionary'
- /**通用直接传入原始配置EChartsOption*/
- function Echarts(props: { children: EChartsOption | null, style?: { width: number | string, height: number | string } }) {
- const { style } = props
- const ref: { current: HTMLDivElement | null } = useRef(null)
- const [myChart, setMyChart] = useState<any>()
- /**创建myChart实例 */
- useEffect(() => {
- if (ref?.current && props?.children) {
- let myChart = init(ref.current)
- setMyChart(myChart)
- myChart.setOption(props.children);
- myChart.resize()
- }
- }, [ref?.current, props?.children])
- /**卸载myChart */
- useEffect(() => {
- return () => {
- if (myChart?.id) {
- dispose(myChart.id)
- }
- }
- }, [myChart?.id])
- return <>
- {
- props.children
- ?
- <div ref={ref} style={style ? style : { width: '100%', height: '100%' }} />
- :
- <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%' }}>
- <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
- </div>
- }
- </>
- }
- /**
- * Map粉丝统计
- * @param data name省名称 vlaue值
- * @param style width ,height
- */
- function Map(props: { data: { name: string, value: number }[], style?: { width: number | string, height: number | string } }) {
- const { data, style } = props
- const ref: { current: HTMLDivElement | null } = useRef(null)
- const [myChart, setMyChart] = useState<any>()
- /**创建myChart实例 */
- useEffect(() => {
- if (ref?.current && data.length > 0) {
- let myChart = init(ref.current)//初始化chart
- registerMap('China', require('../../public/map.json'))//获取地图数据
- let num: number[] = []//获取所有值方便取最大最小值
- let newData: any = china//处理匹配接口返回数据和地图数据的映射避免名字不同
- data.forEach((item: { name: string, value: number }) => {
- newData.forEach((data: { name: string, value: number }) => {
- if (item.name && data.name.indexOf(item.name) !== -1) {
- data.value = item.value
- num.push(item.value)
- }
- })
- })
- setMyChart(myChart)//存放Chart实例以备卸载
- myChart.setOption({//设置Chart配置
- /**悬浮提示 */
- tooltip: {
- trigger: 'item',
- formatter: '{b}:{c}'
- },
- /**右侧操作工具 */
- toolbox: {
- show: true,
- orient: 'vertical',
- right: 50,
- top: 'center',
- feature: {
- dataView: {
- readOnly: false,
- title: '查看详情'
- },
- restore: {
- title: '刷新'
- },
- saveAsImage: {
- title: '保存为图片'
- }
- }
- },
- /**左侧操作工具 */
- visualMap: {
- min: 0,
- max: Math.max(...num),
- text: ['High', 'Low'],
- realtime: false,
- calculable: true,
- top: 'middle',
- inRange: {
- color: ['lightskyblue', 'yellow', 'orangered']
- }
- },
- /**地图参数设置 */
- series: [
- {
- name: '粉丝统计',
- type: 'map',
- map: 'China', // 自定义扩展图表类型
- zoom: 1.2,
- scaleLimit: { min: 1, max: 10 },
- roam: true,
- nameProperty: 'name',
- data: newData,
- }
- ],
- });
- }
- }, [ref?.current, data])
- /**卸载myChart */
- useEffect(() => {
- if (data.length === 0) {
- if (myChart?.id) {
- dispose(myChart.id)
- }
- }
- return () => {
- if (myChart?.id) {
- dispose(myChart.id)
- }
- }
- }, [myChart?.id, data])
- return <>
- {
- data.length > 0 && <div ref={ref} style={style ? style : { width: '100%', height: '100%' }} />
- }
- {
- data.length === 0 && <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%' }}>
- <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
- </div>
- }
- </>
- }
- /**
- * 饼图总关注
- * @param data name 名称 value 值
- * @param style width,height
- * @param name tooltip上的名字即饼图的名字
- * @param centerName 饼图中心统计的名称
- */
- function PieFocus(props: {
- /**
- * @param data name 名称 value 值
- */
- data: { name: string, value: number }[],
- /**
- * @param name tooltip上的名字即饼图的名字
- */
- name: string,
- /**
- * @param centerName 饼图中心统计的名称
- */
- centerName: string,
- /**
- * @param style width,height
- */
- style?: { width: number | string, height: number | string },
- }) {
- const { data, style, name, centerName } = props
- const ref: { current: HTMLDivElement | null } = useRef(null)
- const [myChart, setMyChart] = useState<any>()
- /**创建myChart实例 */
- useEffect(() => {
- if (ref?.current && data.length > 0) {
- let myChart = init(ref.current)
- setMyChart(myChart)
- myChart.setOption({
- /**鼠标悬浮 */
- tooltip: {
- // trigger: 'item',
- // formatter: '{a} <br />{b}: {c} ({d}%)'
- },
- /**图列 */
- legend: {
- left: 'center',
- bottom: 0,
- data: data?.map((item: { name: string }) => item.name)
- },
- /**工具保存为图片 */
- toolbox: {
- right: 50,
- feature: {
- saveAsImage: {
- title: '保存为图片'
- }
- }
- },
- /**饼图参数 */
- series: [
- {
- name,
- type: 'pie',
- radius: ['50%', '70%'],
- // avoidLabelOverlap: false,
- label: {
- show: true,
- // position: 'center',
- // fontSize: '30',
- // fontWeight: 'bold',
- formatter: `{b}:{c} ({d}%)`,
- },
- data
- },
- {
- name,
- type: 'pie',
- radius: ['50%', '70%'],
- label: {
- show: true,
- position: 'center',
- fontSize: '30',
- fontWeight: 'bold',
- formatter: `${data.length > 1 ? data?.reduce((a: any, b: { value: number }) => {
- return (a?.value || a) + (b?.value || 0)
- }) : data[0].value}\n${centerName}`,
- },
- data
- }
- ]
- });
- }
- }, [ref?.current, data])
- /**卸载myChart */
- useEffect(() => {
- if (data.length === 0) {
- if (myChart?.id) {
- dispose(myChart?.id)
- }
- }
- return () => {
- if (myChart?.id) {
- dispose(myChart?.id)
- }
- }
- }, [myChart?.id, data])
- return <>
- {
- data.length > 0 && <div ref={ref} style={style ? style : { width: '100%', height: '100%' }} />
- }
- {
- data.length === 0 && <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%' }} >
- <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
- </div>
- }
- </>
- }
- /**
- * Line 折线图
- * @param data legendName 图列名称 y:x(key为Y轴的展示的名称,value对应X轴的值。例:{legendName:'取消关注','2020-12-12':10,'2020-12-13':11,'2020-12-14':33}[])
- * @param style width,height
- */
- function Line(props: {
- data?: { legendName: string, [key: string]: any }[],
- style?: React.CSSProperties,
- areaStyle?: boolean,//线变块颜色
- color?: string | string[],//线颜色
- markPoint?: any,//浮点
- fontColor?: string,//文字颜色
- series?: boolean,//堆叠
- title?: string,//标题
- smooth?: boolean,//true 圆弧线 false 直角
- }) {
- const { data, style, areaStyle = false, color, markPoint, fontColor, series, title, smooth = false } = props
- const ref: { current: HTMLDivElement | null } = useRef(null)
- const [myChart, setMyChart] = useState<any>()
- let textStyle = fontColor ? { textStyle: { color: fontColor } } : {}
- /**创建myChart实例 */
- useEffect(() => {
- if (ref?.current && (data as any[]).length > 0) {
- let Xdata: any = []
- let Ydatas: any[] = []
- data?.forEach((item, index) => {
- Ydatas.push([])
- Object.keys(item).forEach((key: string) => {
- if (index === 0 && key !== 'legendName') {
- Xdata.push(key)
- }
- if (key !== 'legendName') {
- Ydatas[index].push(item[key])
- }
- })
- })
- let myChart = init(ref.current)
- setMyChart(myChart)
- myChart.setOption({
- /**鼠标悬浮 */
- tooltip: {
- trigger: 'axis'
- },
- /**图列 */
- legend: {
- data: (data as { legendName: string, [key: string]: any }[]).map((item: { legendName: string }) => item.legendName),
- bottom: 0,
- left: 'center',
- ...textStyle
- },
- xAxis: {
- data: Xdata,
- boundaryGap: false,//贴边
- },
- yAxis: [
- {
- type: 'value',
- },
- ],
- grid: {
- left: 100,
- right: 50,
- },
- ...textStyle,
- /**工具保存为图片 */
- toolbox: {
- right: 50,
- feature: {
- saveAsImage: {
- title: '保存为图片'
- }
- }
- },
- title: {
- text: title || '',
- textAlign: 'center',
- right: 'center'
- },
- /**线图参数 */
- series: (data as { legendName: string, [key: string]: any }[]).map((item: { legendName: string }, index: number) => {
- return {
- name: item.legendName,//名称
- type: 'line',//图形
- data: Ydatas[index],//数据
- areaStyle: areaStyle ? {} : undefined,//是否开启块级颜色
- color: Array.isArray(color) ? color[index] : color,//颜色
- markPoint: {//最大值最小值
- data: markPoint ? markPoint : []
- },
- emphasis: series ? { focus: 'series' } : {}, //堆叠
- smooth
- }
- })
- });
- }
- }, [ref?.current, data])
- /**卸载myChart */
- useEffect(() => {
- if ((data as any[])?.length === 0) {
- if (myChart?.id) {
- dispose(myChart?.id)
- }
- }
- return () => {
- if (myChart?.id) {
- dispose(myChart.id)
- }
- }
- }, [myChart?.id, data])
- return <>
- {
- (data as any[])?.length > 0 && <div ref={ref} style={style ? style : { width: '100%', height: '100%' }} />
- }
- {
- (data as any[])?.length === 0 && <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%' }}>
- <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
- </div>
- }
- </>
- }
- /**
- * Bar 柱状图
- * @param data legendName 图列名称 y:x(key为Y轴的展示的名称,value对应X轴的值。例:{legendName:'取消关注','2020-12-12':10,'2020-12-13':11,'2020-12-14':33}[])
- * @param style width,height
- */
- function Bar(props: {
- data?: { legendName: string, [key: string]: any }[],
- style?: React.CSSProperties,
- fontColor?: string,//文字颜色
- title?: string,//标题
- }) {
- const { data, style, fontColor, title } = props
- const ref: { current: HTMLDivElement | null } = useRef(null)
- const [myChart, setMyChart] = useState<any>()
- let textStyle = fontColor ? { textStyle: { color: fontColor } } : {}
- /**创建myChart实例 */
- useEffect(() => {
- if (ref?.current && (data as any[]).length > 0) {
- let Xdata: any = [] // name
- let Ydatas: any[] = [] // value
- data?.forEach((item) => {
- Xdata.push(item.name)
- Ydatas.push(item.value)
- })
- let sum = eval(Ydatas.join("+"))
- Ydatas = Ydatas.map((item: number) => {
- return (item / sum * 100).toFixed(0)
- })
- let myChart = init(ref.current)
- setMyChart(myChart)
- myChart.setOption({
- /**鼠标悬浮 */
- // tooltip: {
- // trigger: 'axis',
- // },
- xAxis: {
- max: 'dataMax'
- },
- yAxis: {
- type: 'category',
- data: Xdata,
- inverse: true
- },
- grid: {
- left: 100,
- right: 50,
- },
- ...textStyle,
- title: {
- text: title || '',
- textAlign: 'center',
- right: 'center'
- },
- /**线图参数 */
- series: [
- {
- type: 'bar',//图形
- realtimeSort: true,
- data: Ydatas,//数据
- name: 'X',
- label: {
- show: true,
- position: 'right',
- valueAnimation: true,
- }
- }
- ]
- });
- }
- }, [ref?.current, data])
- /**卸载myChart */
- useEffect(() => {
- if ((data as any[])?.length === 0) {
- if (myChart?.id) {
- dispose(myChart?.id)
- }
- }
- return () => {
- if (myChart?.id) {
- dispose(myChart.id)
- }
- }
- }, [myChart?.id, data])
- return <>
- {
- (data as any[])?.length > 0 && <div ref={ref} style={style ? style : { width: '100%', height: '100%' }} />
- }
- {
- (data as any[])?.length === 0 && <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%' }}>
- <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
- </div>
- }
- </>
- }
- /**
- * Bar 柱状图
- * @param data legendName 图列名称 y:x(key为Y轴的展示的名称,value对应X轴的值。例:{legendName:'取消关注','2020-12-12':10,'2020-12-13':11,'2020-12-14':33}[])
- * @param style width,height
- */
- // [
- // { name: '4341556373', value: 300 }, { name: '4341523456', value: 240 },
- // ]
- function BarMonitor(props: {
- data?: { legendName: string, [key: string]: any }[],
- style?: React.CSSProperties,
- fontColor?: string,//文字颜色
- title?: string,//标题
- isGraphic?: boolean, // 是否渐变
- xName?: string,
- yName?: string,
- planID?: string,
- onChange?: (id: string, accountId: number[]) => void,
- }) {
- const { data, style, fontColor, title, xName, yName, planID, onChange } = props
- const colors = ['#f8128d', '#fa40a3', '#f56db5', '#f58bc4', '#f7a1cf', '#f5b7d8', '#facee5', '#f8c8e2', '#f8d6e8', '#fae8f1']
- const ref: { current: HTMLDivElement | null } = useRef(null)
- const [myChart, setMyChart] = useState<any>()
- let textStyle = fontColor ? { textStyle: { color: fontColor } } : {}
- /**创建myChart实例 */
- useEffect(() => {
- if (ref?.current && (data as any[]).length > 0) {
- let Xdata: any = [] // name
- let Ydatas: any[] = [] // value
- data?.forEach((item) => {
- Xdata.push(item.adName)
- Ydatas.push(item.value)
- })
- let dataIndex = data?.findIndex((item: any) => item?.name == planID)
- Ydatas = Ydatas.map((item: number, index: number) => {
- if (dataIndex !== -1 && dataIndex === index) {
- return {
- value: item,
- itemStyle: {
- color: '#37A2FF',
- shadowColor: 'rgba(0, 0, 0, 0.8)',
- shadowBlur: 10,
- },
- }
- } else {
- return {
- value: item,
- itemStyle: {
- color: colors[index],
- }
- }
- }
- })
- let myChart = init(ref.current)
- setMyChart(myChart)
- myChart?.setOption({
- /**鼠标悬浮 */
- // tooltip: {
- // trigger: 'axis',
- // },
- xAxis: {
- name: xName || '',
- max: 'dataMax',
- nameTextStyle: { // y轴名字文字样式设置
- verticalAlign: "bottom",
- lineHeight: 5,
- fontWeight: 'bold',
- },
- axisLine: { // 坐标轴轴线相关设置
- show: true // 是否显示坐标轴轴线
- },
- },
- yAxis: {
- name: yName || '',
- type: 'category',
- data: Xdata,
- inverse: true,
- nameLocation: 'start', // y轴名字显示位置
- nameTextStyle: { // y轴名字文字样式设置
- verticalAlign: "bottom",
- lineHeight: 0,
- fontWeight: 'bold',
- color: '#000',
- padding: [0, 80, 0, 0]
- },
- nameGap: 20,
- triggerEvent: true,
- axisLabel: {//名称
- margin: 10,
- width: 80,
- overflow: 'truncate',
- ellipsis: '...',
- color: (value: any, index: any) => {
- if (index === dataIndex) {
- return '#f8128d'
- }
- return '#3946c3'
- },
- },
- },
- grid: {
- left: 100,
- right: 70
- },
- ...textStyle,
- title: {
- text: title || '起量广告排行榜',
- textStyle: {
- color: '#3946c3',
- fontSize: 16
- },
- left: 'center',
- bottom: 0,
- },
- tooltip: {
- show: true,
- // formatter:'{b0}: {c0}',
- formatter: function (a: any) {
- return `${a.marker} <strong> ${a.name} : ${a.value}</strong>`
- }
- },
- series: [
- {
- type: 'bar',//图形
- realtimeSort: true,
- data: Ydatas,//数据
- name: 'X',
- showBackground: true,
- backgroundStyle: {
- color: 'transparent'
- },
- label: {
- show: true,
- valueAnimation: true,
- position: 'right',
- fontSize: 14,
- fontWeight: 900
- }
- }
- ]
- });
- myChart.on('click', (params: any) => {
- let v = params.dataIndex
- let d: any = (data as any[])[v]
- onChange && onChange(d.name, [d.accountId])
- });
- }
- }, [ref?.current, data, planID])
- /**卸载myChart */
- useEffect(() => {
- if ((data as any[])?.length === 0) {
- if (myChart?.id) {
- dispose(myChart?.id)
- }
- }
- return () => {
- if (myChart?.id) {
- dispose(myChart.id)
- }
- }
- }, [myChart?.id, data])
- return <>
- {
- (data as any[])?.length > 0 && <div ref={ref} style={style ? style : { width: '100%', height: '100%' }} />
- }
- {
- (data as any[])?.length === 0 && <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%' }}>
- <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
- </div>
- }
- </>
- }
- /**
- * Line 折线图
- * @param data legendName 图列名称 y:x(key为Y轴的展示的名称,value对应X轴的值。例:{legendName:'取消关注','2020-12-12':10,'2020-12-13':11,'2020-12-14':33}[])
- * @param style width,height
- */
- function LineMonitor(props: {
- data?: { legendName: string, [key: string]: any }[],
- style?: React.CSSProperties,
- areaStyle?: boolean,//线变块颜色
- color?: string | string[],//线颜色
- markPoint?: any,//浮点
- fontColor?: string,//文字颜色
- series?: boolean,//堆叠
- title?: string,//标题
- smooth?: boolean,//true 圆弧线 false 直角
- dataZoomInside?: boolean, // 控制是否开启滚轮缩放
- dataZoomSlider?: boolean, // 控制是否开启组件缩放
- }) {
- const { data, style, areaStyle = false, color, markPoint, fontColor, series, title, smooth = false, dataZoomInside, dataZoomSlider } = props
- const ref: { current: HTMLDivElement | null } = useRef(null)
- const [myChart, setMyChart] = useState<any>()
- let textStyle = fontColor ? { textStyle: { color: fontColor } } : {}
- /**创建myChart实例 */
- useEffect(() => {
- if (ref?.current && (data as any[]).length > 0) {
- let Xdata: any = []
- let Ydatas: any[] = []
- data?.forEach((item, index) => {
- Ydatas.push([])
- Object.keys(item).forEach((key: string) => {
- if (index === 0 && key !== 'legendName') {
- Xdata.push(key)
- }
- if (key !== 'legendName') {
- Ydatas[index].push(item[key])
- }
- })
- })
- let myChart = init(ref.current)
- // 设置是否可缩放
- let dataZoom = []
- if (dataZoomInside) {
- dataZoom.push({
- type: 'inside'
- })
- }
- if (dataZoomSlider) {
- dataZoom.push({
- type: 'slider',
- width: 200,
- height: 20,
- top: 0,
- left: 140,
- disabled: dataZoomSlider
- })
- }
- setMyChart(myChart)
- myChart.setOption({
- /**鼠标悬浮 */
- tooltip: {
- trigger: 'axis'
- },
- /**图列 */
- legend: {
- data: (data as { legendName: string, [key: string]: any }[]).map((item: { legendName: string }) => item.legendName),
- bottom: 0,
- left: 'center',
- show: data && data?.length > 1 ? true : false,//数据只有一条就隐藏
- ...textStyle
- },
- xAxis: {
- data: Xdata,
- boundaryGap: false,//贴边
- },
- yAxis: [
- {
- type: 'value',
- axisLabel: {//名称
- fontWeight: 900,
- fontSize: 15,
- color: '#333333',
- textBorderColor: '#dfdfdf',
- textBorderWidth: 1
- },
- },
- ],
- dataZoom,
- grid: {
- left: 100,
- right: 50,
- },
- ...textStyle,
- /**工具保存为图片 */
- toolbox: {
- right: 50,
- // feature: {
- // saveAsImage: {
- // title: '保存为图片'
- // }
- // }
- },
- title: {
- text: title || '',
- left: 'center',
- bottom: 0,
- textStyle: {
- color: '#3946c3',
- fontSize: 16
- },
- },
- /**线图参数 */
- series: (data as { legendName: string, [key: string]: any }[]).map((item: { legendName: string }, index: number) => {
- return {
- name: item.legendName,//名称
- type: 'line',//图形
- data: Ydatas[index],//数据
- areaStyle: areaStyle ? {} : undefined,//是否开启块级颜色
- color: Array.isArray(color) ? color[index] : color,//颜色
- markPoint: {//最大值最小值
- data: markPoint ? markPoint : []
- },
- emphasis: series ? { focus: 'series' } : {}, //堆叠
- smooth
- }
- })
- });
- }
- }, [ref?.current, data])
- /**卸载myChart */
- useEffect(() => {
- if ((data as any[])?.length === 0) {
- if (myChart?.id) {
- dispose(myChart?.id)
- }
- }
- return () => {
- if (myChart?.id) {
- dispose(myChart.id)
- }
- }
- }, [myChart?.id, data])
- return <>
- {
- (data as any[])?.length > 0 && <div ref={ref} style={style ? style : { width: '100%', height: '100%' }} />
- }
- {
- (data as any[])?.length === 0 && <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%' }}>
- <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
- </div>
- }
- </>
- }
- /**
- * 常用option配置//https://echarts.apache.org/next/zh/option.html#legend
- * @param legend 图例组件 用于用户操作筛选图表展示的组件
- * @param title 图标标题
- * @param grid 网格控制 可在一个渲染框架中渲染多个图表 或单个图表的间距宽高等值的设定
- * @param xAxis grid 中的 x 轴的设置
- * @param yAxis grid 中的 y 轴的设置
- * @param tooltip 鼠标悬浮的提示组件
- * @param series 系列数据配置
- */
- function useEcharts() {
- return {
- Echarts,
- Map,
- PieFocus,
- Line,
- Bar,
- BarMonitor,
- LineMonitor
- }
- }
- export default useEcharts
|