| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122 |
- // 绘制中间动态环图
- const drawWorkShopChart = (myChart, datas) => {
- const options = [];
- let number = 50;
- datas.forEach((item) => {
- const obj = { value: number, name: item.name };
- options.push(obj);
- number += 10;
- });
- const workShopOption = {
- title: [{
- show: true,
- text: "",
- textStyle: {
- color: "white",
- fontSize: 24,
- fontWeight: "bold"
- },
- top: "48%",
- left: "26%"
- },
- ],
- series: [
- {
- name: 'pie',
- type: 'pie',
- width: "80%",
- height: "55%",
- center: ['50%', '50%'],
- top: "center",
- radius: ['54%', '90%'],
- avoidLabelOverlap: false,
- hoverAnimation: false,
- padAngle: 5,
- itemStyle: {
- borderRadius: 10,
- },
- label: {
- show: false,
- position: 'center'
- },
- emphasis: {
- label: {
- show: true,
- fontSize: 24,
- fontWeight: "bold",
- },
- },
- labelLine: {
- show: false
- },
- selectedMode: 'single',
- selectedOffset: 20,
- // 选中的样式
- select: {
- label: {
- show: true,
- fontSize: 24,
- fontWeight: 'bold',
- color: "#ffffff"
- },
- },
- data: options,
- }
- ]
- };
- workShopOption.title[0].text = workShopOption.series[0].data[0].name;
- window.dispatchEvent(
- new CustomEvent("onmessageChange", {
- detail: {
- warehouseId: datas[0].id
- },
- })
- );
- let index = 1;
- window.timeTicket = window.setInterval(() => {
- if (index > datas.length - 1) {
- index = 0
- }
- myChart.dispatchAction({
- type: 'select',
- seriesIndex: 0,
- dataIndex: index
- });
- window.dispatchEvent(
- new CustomEvent("onmessageChange", {
- detail: {
- warehouseId: datas[index].id
- },
- })
- );
- myChart.setOption({
- title: [{ text: '' }],
- });
- index++
- }, 5000)
- return workShopOption
- }
- // 绘制模检具故障数量图
- const drawMalfunctionNumber = () => {
- let category = [
- {
- name: "检具近三十天故障数量",
- value: 0,
- },
- {
- name: "模具近三十天故障数量",
- value: 0,
- },
- ]
- let yName = [];
- let bgData = [];
- let number = []
- let maxValue = 500; //最大值
- category.forEach(element => {
- yName.push(element.name);
- number.push({ name: element.name, value: element.value + '个' })
- bgData.push({
- name: element.name,
- value: maxValue,
- type: element.type,
- });
- });
- const malfunctionNumberOption = {
- xAxis: {
- // max: maxValue,
- splitLine: {
- show: false
- },
- axisLine: {
- show: false
- },
- axisLabel: {
- show: false
- },
- axisTick: {
- show: false
- }
- },
- grid: {
- left: 150,
- top: 20,
- right: 80,
- bottom: 20
- },
- yAxis: [
- { // y轴最左侧的文字
- axisTick: 'none',
- axisLine: 'none',
- position: 'left',
- axisLabel: {
- padding: [0, 0, 0, 0],
- textStyle: {
- color: '#ffffff',
- fontSize: '14',
- }
- },
- data: yName
- },
- { // y轴最右侧的文字
- name: 'right',
- axisTick: 'none',
- axisLine: 'none',
- type: 'category',
- position: 'right',
- axisLabel: {
- margin: 10,
- textStyle: {
- color: '#ffffff',
- fontSize: '14',
- }
- },
- data: number,
- }],
- series: [
- {
- // 背景样式
- name: '背景',
- type: "bar",
- barWidth: 18,
- stack: '总量',
- barGap: '-100%',
- symbol: 'fixed',
- symbolRepeat: 'repeat',
- legendHoverLink: false,
- itemStyle: {
- normal: {
- color: '#131943'
- }
- },
- data: bgData,
- animation: false, //关闭动画
- z: 0
- },
- {
- name: '故障数量',
- // 内(显示的内容)
- type: "bar",
- barGap: '-100%',
- barWidth: 18,
- legendHoverLink: false,
- silent: true,
- itemStyle: {
- normal: {
- color: {
- type: "linear",
- x: 0,
- y: 0,
- x2: 1,
- y2: 0,
- colorStops: [{
- offset: 0,
- color: '#53aee6' // 0% 处的颜色
- },
- {
- offset: 1,
- color: '#ef1dfc' // 100% 处的颜色
- }
- ]
- }
- }
- },
- data: category,
- z: 1,
- animationEasing: "elasticOut"
- },
- {
- // 分隔
- type: "pictorialBar",
- itemStyle: {
- normal: {
- color: 'rgba(0,0,0,1)'
- }
- },
- symbolRepeat: "fixed",
- symbolMargin: '300%',
- symbol: "rect",
- symbolClip: true,
- symbolSize: [5, 21],
- symbolPosition: "start",
- symbolOffset: [0, 0],
- symbolBoundingData: maxValue,
- data: bgData,
- animation: false, //关闭动画
- z: 2
- }
- ]
- };
- return malfunctionNumberOption
- }
- // 绘制模检具故障趋势折线图
- const drawMalfunctionChart = () => {
- let stateData = {
- xData: [],
- yData1: [],
- yData2: [],
- };
- const option = {
- tooltip: {},
- legend: {
- itemWidth: 7,
- itemHeight: 7,
- icon: "rect",
- right: 0,
- textStyle: {
- fontSize: 14,
- fontFamily: "PingFangSC, PingFang SC",
- fontWeight: 400,
- color: "#ffffff",
- },
- orient: "vertical",
- top: "0",
- },
- xAxis: {
- name: "月份",
- type: "category",
- boundaryGap: false,
- data: stateData.xData,
- nameTextStyle: {
- fontSize: 14,
- fontFamily: "PingFangSC, PingFang SC",
- fontWeight: 400,
- color: "#ffffff",
- },
- axisLabel: {
- fontSize: 14,
- fontFamily: "PingFangSC, PingFang SC",
- fontWeight: 400,
- color: "#ffffff",
- },
- },
- yAxis: {
- type: "value",
- name: "数量",
- nameTextStyle: {
- fontSize: 14,
- fontFamily: "PingFangSC, PingFang SC",
- fontWeight: 400,
- color: "#ffffff",
- },
- axisLabel: {
- fontSize: 14,
- fontFamily: "PingFangSC, PingFang SC",
- fontWeight: 400,
- color: "#ffffff",
- },
- splitLine: {
- lineStyle: {
- color: "#5f5f5f",
- },
- },
- },
- series: [
- {
- name: "模具故障趋势",
- data: stateData.yData1,
- type: "line",
- smooth: true,
- label: {
- show: true,
- position: "top",
- color: '#f20d0d'
- },
- itemStyle: {
- normal: {
- color: "#f20d0d",
- lineStyle: {
- color: "#f20d0d",
- width: 2,
- },
- areaStyle: {
- color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
- {
- offset: 0,
- color: "#2d0838",
- },
- {
- offset: 1,
- color: "#43072f",
- },
- ]),
- },
- },
- },
- },
- {
- name: "检具故障趋势",
- data: stateData.yData2,
- type: "line",
- smooth: true,
- label: {
- show: true,
- position: "top",
- color: '#5fafff'
- },
- itemStyle: {
- normal: {
- color: "rgba(95, 175, 255, 1)",
- lineStyle: {
- color: "rgba(95, 175, 255, 1)",
- width: 2,
- },
- areaStyle: {
- color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
- {
- offset: 0,
- color: "rgba(95, 175, 255, 0)",
- },
- {
- offset: 1,
- color: "rgba(95, 175, 255, 1)",
- },
- ]),
- },
- },
- },
- },
- ],
- };
- return option
- }
- // 绘制模具维修时效柱状图
- const drawMaintainChart = () => {
- let xData = ['一天内', '两天内', '三天内', '三天以上',]
- let yData = []
- const offsetX = 20;
- const offsetY = 10;
- // 绘制立体左侧面
- const CubeLeft = echarts.graphic.extendShape({
- shape: {
- x: 0,
- y: 0,
- },
- buildPath: function (ctx, shape) {
- const xAxisPoint = shape.xAxisPoint;
- const c0 = [shape.x, shape.y];
- const c1 = [shape.x - offsetX, shape.y - offsetY];
- const c2 = [xAxisPoint[0] - offsetX, xAxisPoint[1] - offsetY];
- const c3 = [xAxisPoint[0], xAxisPoint[1]];
- ctx.moveTo(c0[0], c0[1]).lineTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).closePath();
- },
- });
- // 绘制立体右侧面
- const CubeRight = echarts.graphic.extendShape({
- shape: {
- x: 0,
- y: 0,
- },
- buildPath: function (ctx, shape) {
- const xAxisPoint = shape.xAxisPoint;
- const c1 = [shape.x, shape.y];
- const c2 = [xAxisPoint[0], xAxisPoint[1]];
- const c3 = [xAxisPoint[0] + offsetX, xAxisPoint[1] - offsetY];
- const c4 = [shape.x + offsetX, shape.y - offsetY];
- ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath();
- },
- });
- // 绘制立体顶面
- const CubeTop = echarts.graphic.extendShape({
- shape: {
- x: 0,
- y: 0,
- },
- buildPath: function (ctx, shape) {
- const c1 = [shape.x, shape.y];
- const c2 = [shape.x + offsetX, shape.y - offsetY]; //右点
- const c3 = [shape.x, shape.y - offsetX];
- const c4 = [shape.x - offsetX, shape.y - offsetY];
- ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath();
- },
- });
- // 注册三个面图形
- echarts.graphic.registerShape('CubeLeft', CubeLeft);
- echarts.graphic.registerShape('CubeRight', CubeRight);
- echarts.graphic.registerShape('CubeTop', CubeTop);
- const option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow',
- },
- formatter: function (params, ticket, callback) {
- const item = params[1];
- return item.name + ' : ' + item.value;
- },
- },
- grid: {
- left: '10%',
- right: '10%',
- top: '15%',
- bottom: '10%',
- containLabel: true,
- },
- textStyle: {
- color: '#ffffff',
- },
- xAxis: {
- name: '天数',
- type: 'category',
- data: xData,
- axisLine: {
- lineStyle: {
- color: '#dddddd',
- },
- },
- axisTick: {
- show: false,
- },
- axisLabel: {
- margin: 10, //刻度标签与轴线之间的距离。
- textStyle: {
- fontFamily: 'Microsoft YaHei',
- color: '#ffffff',
- },
- },
- },
- yAxis: {
- name: "数量",
- nameTextStyle: {
- verticalAlign: 'middle',
- align: "right"
- },
- type: 'value',
- min: 0,
- boundaryGap: ['20%', '60%'],
- axisLine: {
- show: true,
- lineStyle: {
- color: '#ddddddd',
- },
- },
- splitLine: {
- lineStyle: {
- // 使用深浅的间隔色
- color: ['#B5B5B5'],
- type: 'dashed',
- opacity: 0.5,
- },
- },
- },
- series: [
- {
- type: 'custom',
- name: '时效',
- renderItem: (params, api) => {
- const location = api.coord([api.value(0), api.value(1)]);
- return {
- type: 'group',
- children: [
- {
- type: 'CubeLeft',
- shape: {
- api,
- xValue: api.value(0),
- yValue: api.value(1),
- x: location[0],
- y: location[1],
- xAxisPoint: api.coord([api.value(0), 0]),
- },
- style: {
- fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#ff0101',
- },
- {
- offset: 1,
- color: '#5c0001',
- },
- ]),
- },
- },
- {
- type: 'CubeRight',
- shape: {
- api,
- xValue: api.value(0),
- yValue: api.value(1),
- x: location[0],
- y: location[1],
- xAxisPoint: api.coord([api.value(0), 0]),
- },
- style: {
- fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#ff0101',
- },
- {
- offset: 1,
- color: '#5c0001',
- },
- ]),
- },
- },
- {
- type: 'CubeTop',
- shape: {
- api,
- xValue: api.value(0),
- yValue: api.value(1),
- x: location[0],
- y: location[1],
- xAxisPoint: api.coord([api.value(0), 0]),
- },
- style: {
- fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#ff0101',
- },
- {
- offset: 1,
- color: '#5c0001',
- },
- ]),
- },
- },
- ],
- };
- },
- data: yData,
- },
- {
- type: 'bar',
- name: '百分比',
- label: {
- normal: {
- show: true,
- position: 'top',
- formatter: (e) => {
- return e.value / 1000 * 100 + '%';
- },
- fontSize: 16,
- color: '#ffffff',
- offset: [0, -10],
- },
- },
- itemStyle: {
- color: 'transparent',
- },
- data: yData,
- },
- ],
- };
- return option
- }
- // 绘制近七天模检具出入库胶囊柱图
- const drawOutInChart = () => {
- const xData = []
- const yData = [
- "模具入库总数",
- "模具出库总数",
- "检具入库总数",
- "检具出库总数",
- ]
- const totalCost = [100, 100, 100, 100]
- const myColor = ['#f31afd', '#316bf5', '#dd0507', '#1d3184',];
- const option = {
- grid: {
- left: '160',
- right: '100'
- },
- xAxis: {
- type: 'value',
- show: true,
- axisLine: {
- lineStyle: {
- color: '#000642',
- },
- },
- // 不显示刻度线
- axisTick: {
- show: false,
- },
- splitLine: {// 网格线为虚线
- show: false,
- },
- axisLabel: {
- interval: 0,
- color: '#ffffff',
- fontSize: 16
- },
- },
- yAxis: {
- type: 'category',
- axisLabel: {
- margin: 30,
- show: true,
- color: '#ffffff',
- fontSize: 16
- },
- axisTick: {
- show: false,
- },
- axisLine: {
- show: false,
- },
- data: yData
- },
- series: [
- {
- type: 'bar',
- barGap: '-65%',
- barWidth: '30%',
- itemStyle: {
- normal: {
- borderColor: '#0c1b4b',
- borderWidth: 2,
- barBorderRadius: 15,
- color: 'rgba(102, 102, 102,0)'
- },
- },
- z: 1,
- data: totalCost,
- },
- {
- name: "数量",
- type: 'bar',
- barGap: '-85%',
- barWidth: '21%',
- itemStyle: {
- normal: {
- barBorderRadius: 16,
- color: (params) => {
- var num = myColor.length;
- return {
- type: "linear",
- x: 0,
- y: 0,
- x2: 1,
- y2: 1,
- colorStops: [
- {
- offset: 1,
- color: "#52afe6",
- },
- {
- offset: 0,
- color: myColor[params.dataIndex % num],
- },
- ],
- };
- },
- }
- },
- max: 1,
- label: {
- normal: {
- show: true,
- position: 'inside',
- formatter: '{c}',
- color: '#ffffff',
- offset: [0, 2],
- }
- },
- labelLine: {
- show: true,
- },
- z: 2,
- data: xData,
- }]
- }
- return option
- }
- // 绘制左下角模检具数量饼图
- const drawCountChart = (dieCountChart, data) => {
- let value = 0
- const option2 = {
- title: {
- text: "{a|" + "总数" + "\n " + value + "}{c|}",
- top: "44%",
- textAlign: "center",
- left: "49%",
- textStyle: {
- color: "#00baff",
- fontSize: 22,
- fontWeight: "400",
- rich: {
- a: {
- fontSize: 30,
- color: "#00baff",
- fontWeight: "600",
- },
- c: {
- fontSize: 40,
- color: "#00baff",
- padding: [6, 4],
- },
- },
- },
- },
- tooltip: {
- trigger: "item",
- },
- series: [
- // 最内层的装饰圆(内一)
- {
- type: "pie",
- name: "装饰内圆",
- radius: ["20%", "20.5%"],
- hoverAnimation: false, //鼠标悬浮放大
- clockWise: false, //是否顺时针
- itemStyle: {
- normal: {
- color: "#87CEFA ",
- },
- },
- label: {
- show: false,
- },
- tooltip: {
- show: false,
- },
- data: [{ value: 0, name: 'smallPie' }],
- },
- // 真正显示数据的圆(内二)
- {
- type: "pie",
- name: "模检具数量",
- radius: ["23%", "28%"],
- avoidLabelOverlap: false,
- hoverAnimation: true,
- color: ["#50aee4", "#f90c29", "#2f67f6", "#0d2983"],
- label: {
- normal: {
- formatter: "{b} {c}",
- // distanceToLabelLine: 2,
- fontSize: 16,
- fontWeight: 600,
- color: "#ffffff",
- },
- },
- // 折线样式
- labelLine: {
- normal: {
- show: true,
- length: 20,
- length2: 50,
- minTurnAngle: 150,
- lineStyle: {
- width: 2,
- },
- },
- },
- // 圆环样式
- itemStyle: {
- normal: {
- shadowBlur: 10,
- shadowColor: "#00ffff",
- },
- },
- // 高亮状态的扇区和标签样式
- emphasis: {
- label: {
- show: true,
- fontSize: 13,
- fontWeight: "bold",
- },
- },
- data,
- },
- // 自动转圈虚线圆(内三)
- {
- type: "pie",
- name: "3",
- silent: false,
- radius: ["30%", "31%"],
- hoverAnimation: false,
- label: {
- normal: {
- show: false,
- },
- },
- labelLine: {
- normal: {
- show: false,
- },
- },
- data: _pie3(),
- },
- // 两个浅颜色的装饰圆
- {
- type: "pie",
- name: "4",
- silent: false,
- radius: ["37%", "38%"],
- color: "rgba(88,142,197,0.4) ",
- hoverAnimation: false,
- label: {
- normal: {
- show: false,
- },
- },
- labelLine: {
- normal: {
- show: false,
- },
- },
- data: [{ value: 0, name: 'midPie' }, { value: 10, name: 'midPie2' }],
- },
- // 自动转圈的两个大圆弧(外四)
- {
- type: "pie",
- name: "5",
- silent: false,
- radius: ["38%", "40%"],
- // startAngle: 75,
- hoverAnimation: false,
- label: {
- normal: {
- show: false,
- },
- },
- labelLine: {
- normal: {
- show: false,
- },
- },
- data: _pie5(),
- },
- // 最外层的三个自动转圈的小圆弧(外二)
- {
- type: "pie",
- name: "6",
- silent: false,
- radius: ["42%", "43%"],
- // startAngle: 75,
- hoverAnimation: false,
- label: {
- normal: {
- show: false,
- },
- },
- labelLine: {
- normal: {
- show: false,
- },
- },
- data: _pie6(),
- },
- // 最大圆浅色(外一)
- {
- type: "pie",
- name: "7",
- silent: false,
- radius: ["45%", "47%"],
- color: "rgba(88,142,197,0.4) ",
- hoverAnimation: false,
- label: {
- normal: {
- show: false,
- },
- },
- labelLine: {
- normal: {
- show: false,
- },
- },
- data: [{ value: 0, name: 'bigPie' }],
- },
- ],
- };
- function _pie3() {
- let dataArr = [];
- for (var i = 0; i < 149; i++) {
- if (i % 2 === 0) {
- dataArr.push({
- value: 1, //黑色间隔
- name: "aaa",
- itemStyle: {
- normal: {
- color: "rgba(88,142,197,0)",
- borderWidth: 0,
- borderColor: "rgba(0,0,0,0)",
- },
- },
- });
- } else {
- dataArr.push({
- value: 1,
- name: "ooo",
- itemStyle: {
- normal: {
- color: "#87CEFA ",
- borderWidth: 0,
- borderColor: "rgba(0,0,0,0)",
- },
- },
- });
- }
- }
- dataArr.push({
- value: 50,
- itemStyle: {
- normal: {
- color: "#87CEFA",
- borderWidth: 0,
- borderColor: "rgba(0,0,0,0)",
- },
- },
- });
- return dataArr;
- }
- function _pie5() {
- let dataArr = [];
- // for (var i = 0; i < 2; i++) {
- dataArr.push(
- {
- value: 15, //黑色间隔
- itemStyle: {
- normal: {
- color: "rgba(88,142,197,0)",
- borderWidth: 0,
- borderColor: "rgba(0,0,0,0)",
- },
- },
- },
- {
- value: 20,
- itemStyle: {
- normal: {
- color: "#87CEFA",
- borderWidth: 0,
- borderColor: "rgba(0,0,0,0)",
- },
- },
- },
- {
- value: 50,
- itemStyle: {
- normal: {
- color: "rgba(88,142,197,0)",
- borderWidth: 0,
- borderColor: "rgba(0,0,0,0)",
- },
- },
- },
- {
- value: 20,
- itemStyle: {
- normal: {
- color: "#87CEFA",
- borderWidth: 0,
- borderColor: "rgba(0,0,0,0)",
- },
- },
- }
- );
- return dataArr;
- }
- function _pie6() {
- let dataArr = [];
- for (var i = 0; i < 1; i++) {
- dataArr.push(
- {
- value: 3,
- itemStyle: {
- normal: {
- color: "#87CEFA",
- borderWidth: 0,
- borderColor: "rgba(0,0,0,0)",
- },
- },
- },
- {
- value: 1, //黑色间隔
- itemStyle: {
- normal: {
- color: "rgba(88,142,197,0)",
- borderWidth: 0,
- borderColor: "rgba(0,0,0,0)",
- },
- },
- },
- {
- value: 5,
- itemStyle: {
- normal: {
- color: "#87CEFA",
- borderWidth: 0,
- borderColor: "rgba(0,0,0,0)",
- },
- },
- },
- {
- value: 2,
- itemStyle: {
- normal: {
- color: "rgba(88,142,197,0)",
- borderWidth: 0,
- borderColor: "rgba(0,0,0,0)",
- },
- },
- },
- {
- value: 10,
- itemStyle: {
- normal: {
- color: "#87CEFA",
- borderWidth: 0,
- borderColor: "rgba(0,0,0,0)",
- },
- },
- },
- {
- value: 150,
- itemStyle: {
- normal: {
- color: "rgba(88,142,197,0)",
- borderWidth: 0,
- borderColor: "rgba(0,0,0,0)",
- },
- },
- }
- );
- }
- return dataArr;
- }
- // function doing() {
- // let option1 = dieCountChart.getOption();
- // option1.series[2].startAngle = option1.series[2].startAngle + 10;
- // option1.series[4].startAngle = option1.series[4].startAngle - 10;
- // option1.series[5].startAngle = option1.series[5].startAngle + 5;
- // dieCountChart.setOption(option1);
- // }
- // function startTimer() {
- // timer = setInterval(doing, 100);
- // }
- // 过渡完成后开始动画
- // dieCountChart.on("finished", () => {
- // setTimeout(startTimer, 0);
- // });
- return option2
- }
- // 初始化图表
- const initChart = (chart, chartOption) => {
- chart && chart.resize();
- chart && chart.clear(); // 清除上次的数据
- chart && chart.setOption(chartOption, true); // 参数配置
- }
|