1.0.5 • Published 4 years ago
abstruse-echart v1.0.5
安装
cnpm install abstruse-echart --save引用
import {AbstruseEchart} from 'abstruse-echart'初始化
const a = new AbstruseEchart.SingleNumber()  
const dom = document.getElementById('eContainer9')  
const newChart = echarts.init(dom);  
a.initCarMeter()  
newChart.setOption(a.option);具体使用:

const a = new AbstruseEchart.SingleNumber()  
const dom = document.getElementById('eContainer9')  
const newChart = echarts.init(dom);  
a.initCarMeter()  
newChart.setOption(a.option);
const a = new AbstruseEchart.SingleNumber()  
const dom = document.getElementById('eContainer10')  
const newChart = echarts.init(dom);  
a.singlePie(90, '#111111')  
newChart.setOption(a.option);
const a = new AbstruseEchart.Pie()  
const dom = document.getElementById('eContainer8')  
const newChart = echarts.init(dom);  
a.init()  
a.changeLegendPosition('right')  
newChart.setOption(a.option);
const a = new AbstruseEchart.Pie()  
const dom = document.getElementById('eContainer8_1')  
const newChart = echarts.init(dom);  
const echartData = [  
    {name: "农村党支部", value: 236, count: 4423, rate: 0},  
  {name: "gaili", value: 236, count: 4423, rate: 0},  
]  
const name = '默认'  
a.circlePie(echartData, name, newChart)  
a.changeLegendPosition('bottom')  
newChart.setOption(a.option);
const a = new AbstruseEchart.Pie()  
const dom = document.getElementById('eContainer8_2')  
const newChart = echarts.init(dom);  
const data = [  
    {name: "村(居)民小组党组织书记和主任", value: 88},  
  {name: "村(居)", value: 288},  
  {name: "村(党组织书记和主任", value: 288},  
]  
a.deformityPie(data)  
newChart.setOption(a.option);
const a = new AbstruseEchart.Pie()
const dom = document.getElementById('eContainer8_3')
const newChart = echarts.init(dom);
a.initMotherSon()  
const dataMother = [
    //母图
  {
        value: 335, //占比
  name: '少数民族', //描述项  
  },
  {
        value: 310,
  name: '汉族',
  },  
]
const dataChildren = 
    {
        value: 335, //占比
  name: '白族', //描述项
  selected: true,
  },
  {
        value: 679,
  name: '黑族',
  },
  {
        value: 1548,
  name: '彝族',
  }
a.updataMotherSon(dataMother, dataChildren)
newChart.setOption(a.option);