| | |
| | | myChart = echarts.init(chartDom); |
| | | let option; |
| | | let lineColor = "#35ddc74d"; |
| | | let spirit = "/cockpitPage/order-bg.png"; |
| | | if (data) { |
| | | option = { |
| | | color: ["#00FFFF", "#dcb018"], |
| | |
| | | trigger: "axis", |
| | | axisPointer: { |
| | | type: "none", |
| | | }, |
| | | textStyle: { |
| | | color: "#00FFFF", |
| | | }, |
| | | borderColor: "#00FFFF", |
| | | backgroundColor: "#238d8d6b", |
| | | valueFormatter: function (value) { |
| | | return value + "%"; |
| | | }, |
| | | }, |
| | | grid: { |
| | |
| | | fontSize: 12, |
| | | textStyle: { |
| | | color: function (params, index) { |
| | | let colorList = ["#dcb018", "#00FFFF"]; |
| | | let colorList = ["#fec718", "#00FFFF"]; |
| | | if (index % 2 == 0) { |
| | | return colorList[0]; |
| | | } else { |
| | |
| | | xAxis: [ |
| | | { |
| | | type: "value", |
| | | name: "单位:件", |
| | | // name: "单位:件", |
| | | // min: data.yAxis[0].min?data.yAxis.min:0, |
| | | minInterval: 1, //坐标轴是整数 |
| | | max: Math.ceil(eval(`Math.max(${data.datay})`) / 5) * 5, //数据最大值加3 |
| | |
| | | ], |
| | | series: [ |
| | | { |
| | | type: "bar", |
| | | type: "pictorialBar", |
| | | name: "", |
| | | barWidth: "15", |
| | | symbol: spirit, |
| | | symbolRepeat: true, |
| | | symbolMargin: "25%", |
| | | symbolClip: true, |
| | | symbolSize: [4, 11], |
| | | barCategoryGap: "40%", |
| | | label: { |
| | | show: true, |
| | | position: "right", |
| | |
| | | color: "#00FFFF", |
| | | }, |
| | | b: { |
| | | color: "#dcb018", |
| | | color: "#fccd1d", |
| | | }, |
| | | }, |
| | | }, |
| | |
| | | //柱形图圆角,初始化效果 |
| | | barBorderRadius: [4, 4, 0, 0], |
| | | color: function (params) { |
| | | let colorList = ["#dcb018", "#00FFFF"]; |
| | | let colorList = ["#fccd1d", "#00FFFF"]; |
| | | if (params.dataIndex % 2 == 0) { |
| | | return colorList[0]; |
| | | } else { |
| | |
| | | }, |
| | | getChartRight(chartName, data) { |
| | | let chartDom = this.$refs[chartName]; |
| | | // let myRightChart = echarts.init(chartDom); |
| | | if ( |
| | | myRightChart != null && |
| | | myRightChart != "" && |
| | |
| | | } |
| | | myRightChart = echarts.init(chartDom); |
| | | let img = "/cockpitPage/dotted-circle.png"; |
| | | let height = myRightChart.getHeight() / 1; |
| | | let width = height + 5; |
| | | let option; |
| | | if (data) { |
| | | option = { |
| | | color: ["#dcb018", "#735b09", "#ebd68e", "#c7b36e"], |
| | | tooltip: { |
| | | trigger: "item", |
| | | textStyle: { |
| | | color: "#00FFFF", |
| | | }, |
| | | borderColor: "#00FFFF", |
| | | backgroundColor: "#238d8d6b", |
| | | valueFormatter: function (value) { |
| | | return value + "%"; |
| | | }, |
| | | }, |
| | | graphic: { |
| | | elements: [ |
| | | { |
| | | type: "image", |
| | | z: 3, |
| | | // z: 3, |
| | | style: { |
| | | image: img, |
| | | width: 240, |
| | | height: 240, |
| | | width: width, |
| | | height: height, |
| | | }, |
| | | left: "center", |
| | | top: "center", |
| | |
| | | }, |
| | | series: [ |
| | | { |
| | | name: "Access From", |
| | | name: "人员技能比", |
| | | type: "pie", |
| | | radius: ["52%", "62%"], |
| | | avoidLabelOverlap: false, |
| | | |
| | | label: { |
| | | normal: { |
| | | position: "outer", |
| | |
| | | borderWidth: 5, |
| | | borderRadius: 4, |
| | | formatter: function (params) { |
| | | return `{a|${params.name}} {b|${params.value + "%"}}`; |
| | | let label = |
| | | params.name.length > 4 |
| | | ? `${params.name.slice(0, 3)}...` |
| | | : params.name; |
| | | return `{a|${label}} {b|${params.value + "%"}}`; |
| | | }, |
| | | rich: { |
| | | a: { |
| | |
| | | labelLine: { |
| | | show: true, |
| | | length: 4, |
| | | length2: 80, |
| | | length2: 70, |
| | | lineStyle: { |
| | | color: "#dcb018", |
| | | }, |
| | |
| | | <style scoped lang="scss"> |
| | | .bar-chart { |
| | | width: 100%; |
| | | height: calc(100% - 20px); |
| | | height: calc(100% - 10px); |
| | | padding: 20px 0 0; |
| | | |
| | | .bar-contents { |
| | |
| | | |
| | | .chart-left { |
| | | width: calc(60% - 20px); |
| | | height: 100%; |
| | | height: calc(100% - 20px); |
| | | margin-right: 20px; |
| | | float: left; |
| | | border: 1px solid #00ffff; |
| | |
| | | .chart-right { |
| | | width: 40%; |
| | | float: left; |
| | | height: 100%; |
| | | height: calc(100% - 20px); |
| | | position: relative; |
| | | .chart-bg { |
| | | width: 100%; |