123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971 |
- let app = new Vue({
- el: '#app',
- data () {
- return {
- echart1Fd: true,
- echart2Fd: true,
- echart3Fd: true,
- echarts1Time: 16000,
- titleList: [
- { name: '初步设计', type: 1, number: '106' },
- { name: '', type: 1, number: '' },
- { name: '详细设计', type: 1, number: '103' },
- { name: '', type: 1, number: '' },
- { name: '施工', type: 1, number: '62' },
- { name: '', type: 1, number: '' },
- { name: '完工', type: 1, number: '35' },
- { name: '', type: 1, number: '' },
- { name: '验收', type: 2, number: '42' },
- { name: '', type: 1, number: '' },
- { name: '结算', type: 1, number: '33' }
- ],
- centerLeftList: [
- { name: '正偏差', value: '160', value2: '500' },
- { name: '容差内', value: '28', value2: '264' },
- { name: '负偏差', value: '103', value2: '182' }
- ],
- time: '',
- timer: '',
- }
- },
- created () {
- this.time = formatDate()
- this.timer = setInterval(() => {
- this.time = formatDate()
- })
- },
- beforeDestroy () {
- if (this.timer) {
- clearInterval(this.timer);
- }
- },
- mounted () {
- setTimeout(() => {
- this.initChart1()
- this.initChart2()
- this.initChart3()
- this.initChart4()
- this.initChart5()
- })
- },
- methods: {
- initChart1 () {
- let that = this
- let myChart = echarts.init(this.$refs['echart1'])
- myChart.on('showTip', (params) => {
- // 如果是7或者15并且满足防抖则切换
- if ((params.dataIndex == 5 || params.dataIndex == 11) && that.echart1Fd) {
- that.echart1Fd = false
- setTimeout(() => {
- option.dataZoom[0].endValue = option.dataZoom[0].endValue + 6
- option.dataZoom[0].startValue = option.dataZoom[0].startValue + 6
- myChart.setOption(option);
- // 防止勿刷新做的防抖
- setTimeout(() => {
- that.echart1Fd = true
- }, 2000)
- }, 1900);
- // 如果是17表示到了最后一个,那么重新来一遍
- } else if (params.dataIndex == 17 && that.echart1Fd) {
- that.echart1Fd = false
- setTimeout(() => {
- option.dataZoom[0].endValue = 0
- option.dataZoom[0].startValue = 5
- myChart.setOption(option);
- // 防止勿刷新做的防抖
- setTimeout(() => {
- that.echart1Fd = true
- }, 2000)
- }, 1900)
- }
- })
- let option = {
- tooltip: {
- formatter: data => {
- return `${data[0].name}<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[0].color.colorStops[0].color}"></span> ${data[0].seriesName}:${data[0].value}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[1].color.colorStops[0].color}"></span> ${data[1].seriesName}:${data[1].value}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[2].color.colorStops[0].color}"></span> ${data[2].seriesName}:${data[2].value}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[3].color.colorStops[0].color}"></span> ${data[3].seriesName}:${data[3].value}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[4].color.colorStops[0].color}"></span> ${data[4].seriesName}:${data[4].value}亿`
- },
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- },
- },
- dataZoom: [
- {
- // start: 9,//默认为@
- // end: 100,//黑认认为1@0
- type: "slider",
- show: false,
- // xAxisIndex: [0]
- handlesize: 0,//滑动条的 左右2个滑动条的大小
- startValue: 5,// 初始显示值
- endValue: 0,// 结束显示值
- height: 10,//组件高度
- left: "5%",
- right: "4%",//右边的距离
- bottom: "25%",//底边的距离
- borderColor: "#939",
- fillerColor: "#269cdb",
- borderRadius: 5,
- backgroundColor: "#33384b",//两边未选中的滑动条区域的额色
- showDataShadow: false,//是否显示数据阴影
- showDetail: false,//即拖拽时候是否显示详细数值信息
- truerealtime: true,//是否实时更新
- filterMode: "filter"
- }, {
- type: 'inside',
- show: true,
- start: 1,
- end: 100
- }
- ],
- grid: {
- top: '16%',
- right: '3%',
- left: '5%',
- bottom: '10%',
- },
- legend: {
- data: ["预算额", "已签合同额", '产值认定额', '结算额', '付款额'],
- x: 'center',
- y: '20px',
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- xAxis: {
- data: echart1.map(item => item.name),
- axisLine: {
- show: true, //隐藏X轴轴线
- lineStyle: {
- color: '#005094',
- width: 1,
- },
- },
- axisTick: {
- show: false, //隐藏X轴刻度
- },
- axisLabel: {
- show: true,
- // rotate: 40,
- textStyle: {
- color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
- },
- },
- },
- yAxis: [
- {
- type: 'value',
- name: '亿元',
- nameTextStyle: {
- color: 'rgba(255,255,255,0.6)',
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#68b4dd66',
- type: 'dashed',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#3D7495',
- },
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- },
- ],
- series: [
- {
- name: '预算额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#71D5FF',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart1.map(item => item.value),
- },
- {
- name: '已签合同额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#4D6FF6',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart1.map(item => item.value2),
- },
- {
- name: '产值认定额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#877CFC',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart1.map(item => item.value),
- },
- {
- name: '结算额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#52BF80',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart1.map(item => item.value2),
- },
- {
- name: '付款额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#CADD62',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart1.map(item => item.value),
- },
- ],
- }
- myChart.setOption(option)
- tools.loopShowTooltip(myChart, option, {
- interval: 2000,
- loopSeries: true,
- })
- },
- initChart2 () {
- let that = this
- const itemStyle = {
- // opacity: 0.8,
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowOffsetY: 0,
- shadowColor: 'rgba(0,0,0,0.3)'
- };
- let myChart = echarts.init(this.$refs['echart2'])
- myChart.on('showTip', (params) => {
- // 如果是7或者15并且满足防抖则切换
- if ((params.dataIndex == 5 || params.dataIndex == 11) && that.echart2Fd) {
- that.echart2Fd = false
- setTimeout(() => {
- option.dataZoom[0].endValue = option.dataZoom[0].endValue + 6
- option.dataZoom[0].startValue = option.dataZoom[0].startValue + 6
- myChart.setOption(option);
- // 防止勿刷新做的防抖
- setTimeout(() => {
- that.echart2Fd = true
- }, 2000)
- }, 1900);
- // 如果是17表示到了最后一个,那么重新来一遍
- } else if (params.dataIndex == 17 && that.echart2Fd) {
- that.echart2Fd = false
- setTimeout(() => {
- option.dataZoom[0].endValue = 0
- option.dataZoom[0].startValue = 5
- myChart.setOption(option);
- // 防止勿刷新做的防抖
- setTimeout(() => {
- that.echart2Fd = true
- }, 2000)
- }, 1900)
- }
- })
- let option = {
- color: ['#80F1BE', '#fec42c', '#dd4444'],
- title: {
- textStyle: {
- color: '#69C0FF',
- fontSize: 16,
- fontWeight: 500
- },
- top: '10',
- left: '10'
- },
- dataZoom: [
- {
- // start: 9,//默认为@
- // end: 100,//黑认认为1@0
- type: "slider",
- show: false,
- // xAxisIndex: [0]
- handlesize: 0,//滑动条的 左右2个滑动条的大小
- startValue: 5,// 初始显示值
- endValue: 0,// 结束显示值
- height: 10,//组件高度
- left: "5%",
- right: "4%",//右边的距离
- bottom: "25%",//底边的距离
- borderColor: "#939",
- fillerColor: "#269cdb",
- borderRadius: 5,
- backgroundColor: "#33384b",//两边未选中的滑动条区域的额色
- showDataShadow: false,//是否显示数据阴影
- showDetail: false,//即拖拽时候是否显示详细数值信息
- truerealtime: true,//是否实时更新
- filterMode: "filter"
- }, {
- type: 'inside',
- show: true,
- start: 1,
- end: 100
- }
- ],
- legend: {
- top: 10,
- data: ['正偏差', '容差', '负偏差'],
- textStyle: {
- fontSize: 12,
- color: '#fff'
- }
- },
- textStyle: {
- color: '#fff',
- },
- tooltip: {
- show: true,
- trigger: "axis",
- formatter: data => {
- return `${data[0].value[0]}<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[0].color}"></span> ${data[0].seriesName}:${data[0].data[1]}亿<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[1].color}"></span> ${data[1].seriesName}:${data[1].data[1]}亿<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[2].color}"></span> ${data[2].seriesName}:${data[2].data[1]}亿`
- },
- axisPointer: {
- type: 'cross',
- },
- // axisPointer: {
- // lineStyle: {
- // type: 'dashed',
- // width: 2,
- // color: 'rgba(255,255,255,0.6)'
- // },
- // animation: true
- // }
- },
- grid: {
- top: '15%',
- right: '5%',
- left: '6%',
- bottom: '10%',
- },
- yAxis: {
- name: '亿元',
- splitLine: {
- show: true,
- lineStyle: {
- color: '#68b4dd66',
- type: 'dashed',
- },
- },
- axisLine: {
- show: false
- },
- axisLabel: {
- show: true,
- formatter: '{value}',
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- nameTextStyle: {
- color: '#fff',
- fontSize: 10,
- },
- },
- xAxis: {
- data: echart2[0].map(item => item[0]),
- axisLine: {
- show: true, //隐藏X轴轴线
- lineStyle: {
- color: '#005094',
- width: 1,
- },
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#68b4dd66',
- type: 'dashed',
- },
- },
- axisTick: {
- show: false, //隐藏X轴刻度
- },
- axisLabel: {
- show: true,
- // rotate: 40,
- padding: [0,0 , 0, 0],
- textStyle: {
- color: '#fff', //X轴文字颜色
- fontSize: 12,
- },
- },
- },
- series: [
- {
- name: '正偏差',
- type: 'scatter',
- itemStyle: itemStyle,
- data: echart2[0],
- symbolSize: function (data) {
- return Math.sqrt(data[1]) * 4;
- },
- },
- {
- name: '容差',
- type: 'scatter',
- itemStyle: itemStyle,
- data: echart2[1],
- symbolSize: function (data) {
- return Math.sqrt(data[1]) * 4;
- },
- },
- {
- name: '负偏差',
- type: 'scatter',
- itemStyle: itemStyle,
- data: echart2[2],
- symbolSize: function (data) {
- return Math.sqrt(data[1]) * 4;
- },
- }
- ]
- }
- myChart.setOption(option)
- tools.loopShowTooltip(myChart, option, {
- interval: 2000,
- loopSeries: true,
- })
- },
- initChart3 () {
- let that = this
- let myChart = echarts.init(this.$refs['echart3'])
- myChart.on('showTip', (params) => {
- // 如果是7或者15并且满足防抖则切换
- if ((params.dataIndex == 5 || params.dataIndex == 11) && that.echart3Fd) {
- that.echart3Fd = false
- setTimeout(() => {
- option.dataZoom[0].endValue = option.dataZoom[0].endValue + 6
- option.dataZoom[0].startValue = option.dataZoom[0].startValue + 6
- myChart.setOption(option);
- // 防止勿刷新做的防抖
- setTimeout(() => {
- that.echart3Fd = true
- }, 2000)
- }, 1900);
- // 如果是17表示到了最后一个,那么重新来一遍
- } else if (params.dataIndex == 17 && that.echart3Fd) {
- that.echart3Fd = false
- setTimeout(() => {
- option.dataZoom[0].endValue = 0
- option.dataZoom[0].startValue = 5
- myChart.setOption(option);
- // 防止勿刷新做的防抖
- setTimeout(() => {
- that.echart3Fd = true
- }, 2000)
- }, 1900)
- }
- })
- let option = {
- tooltip: {
- formatter: data => {
- return `${data[0].name}<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[0].color.colorStops[0].color}"></span> ${data[0].seriesName}:${data[0].value}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[1].color.colorStops[0].color}"></span> ${data[1].seriesName}:${data[1].value}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[2].color.colorStops[0].color}"></span> ${data[2].seriesName}:${data[2].value}亿`
- },
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- },
- position: (params) => {
- return [params[0] + 10, 30]
- },
- },
- dataZoom: [
- {
- // start: 9,//默认为@
- // end: 100,//黑认认为1@0
- type: "slider",
- show: false,
- // xAxisIndex: [0]
- handlesize: 0,//滑动条的 左右2个滑动条的大小
- startValue: 5,// 初始显示值
- endValue: 0,// 结束显示值
- height: 10,//组件高度
- left: "5%",
- right: "4%",//右边的距离
- bottom: "25%",//底边的距离
- borderColor: "#939",
- fillerColor: "#269cdb",
- borderRadius: 5,
- backgroundColor: "#33384b",//两边未选中的滑动条区域的额色
- showDataShadow: false,//是否显示数据阴影
- showDetail: false,//即拖拽时候是否显示详细数值信息
- truerealtime: true,//是否实时更新
- filterMode: "filter"
- }, {
- type: 'inside',
- show: true,
- start: 1,
- end: 100
- }
- ],
- grid: {
- top: '20%',
- right: '3%',
- left: '10%',
- bottom: '28%',
- },
- legend: {
- data: ["高风险", "中风险", '低风险'],
- x: 'center',
- y: '0px',
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- xAxis: {
- data: echart1.map(item => item.name),
- axisLine: {
- show: true, //隐藏X轴轴线
- lineStyle: {
- color: '#005094',
- width: 1,
- },
- },
- axisTick: {
- show: false, //隐藏X轴刻度
- },
- axisLabel: {
- show: true,
- rotate: 40,
- textStyle: {
- color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
- },
- },
- },
- yAxis: [
- {
- type: 'value',
- name: '亿元',
- nameTextStyle: {
- color: 'rgba(255,255,255,0.6)',
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#68b4dd66',
- type: 'dashed',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#3D7495',
- },
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- },
- ],
- series: [
- {
- name: '高风险',
- type: 'bar',
- stack: 'Ad',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#CADD62',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart3.map(item => item.value),
- },
- {
- name: '中风险',
- type: 'bar',
- stack: 'Ad',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#4D6FF6',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart3.map(item => item.value2),
- },
- {
- name: '低风险',
- type: 'bar',
- stack: 'Ad',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#52BF80',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart3.map(item => item.value3),
- },
- ],
- }
- myChart.setOption(option)
- tools.loopShowTooltip(myChart, option, {
- interval: 2000,
- loopSeries: true,
- })
- },
- initChart4 () {
- let myChart = echarts.init(this.$refs['echart4'])
- option = {
- title: {
- text: ''
- },
- // legend: {
- // data: ['安全风险', '付款风险', '合同风险', '结算风险', '进度风险', '质量风险'],
- // textStyle: {
- // color: '#9DB9EB',
- // },
- // top: 'center',
- // right:'50',
- // orient: 'vertical', // vertical 竖着
- // },
- radar: {
- // shape: 'circle',
- center: ['50%', '50%'],
- radius: 55,
- indicator: [
- { name: '安全风险', max: 100000 },
- { name: '付款风险', max: 100000 },
- { name: '合同风险', max: 100000 },
- { name: '结算风险', max: 100000 },
- { name: '进度风险', max: 100000 },
- { name: '质量风险', max: 100000 },
- ],
- axisLine: { // 设置雷达图中间射线的颜色
- lineStyle: {
- color: '#887d33',
- },
- },
- splitLine: { //网格颜色设置
- show: true,
- lineStyle: {
- width: 1,
- color: ['#871b1a', '#638f41', '#d29e35', '#b6802b']
- // color: '#000',
- // color:(color)=>{
- // console.log(color,'??????')
- // }
- },
- },
- name: { //修改indicator文字的颜色
- textStyle: {
- color: "#fff"
- }
- },
- splitNumber: 4, //有几个圈
- splitArea: { //设置图表颜色,show的值为true
- show: true,
- areaStyle: {
- // color:"#c1ddf8", //一般设置方式
- //设置渐变背景色 new echarts.graphic.LinearGradient(a,b,c,d,arr)
- //a ,b,c,d值可为0,1 a:1表示arr中的颜色右到左;c:1 arr中的颜色左到右
- //b:1表示arr中的颜色下到上;d:1表示arr中的颜色上到下
- // color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
- // { offset: 0, color: '#887D33' }, // 0% 处的颜色
- // { offset: 0.75, color: '#7D4216' }, // 0% 处的颜色
- // { offset: 1, color: '#430705' }// 100% 处的颜色
- // ], false)
- color: ['#638f41', '#887d33', '#7d4216', '#430705'],
- }
- }
- },
- series: [
- {
- name: '',
- type: 'radar',
- symbol: 'circle', // 单个数值点的样式,还可以取值'rect','angle'等
- symbolSize: 0, // 数值点的大小
- data: [
- {
- value: echart4[0],
- name: '安全风险',
- itemStyle: { //该数值区域样式设置
- normal: {
- color: 'rgb(44,198,255,0.8)', //背景颜色,还需设置areaStyle
- lineStyle: {
- color: 'rgb(44,198,255,0.8)', //边框颜色
- },
- },
- },
- label: { //显示value中具体的数值
- normal: {
- show: false,
- textStyle: { //更改数值样式
- color: '#43EDE3'
- }
- },
- },
- areaStyle: { //设置区域背景颜色透明度
- normal: {
- width: 1,
- opacity: 0.8,
- },
- },
- }
- ]
- }
- ]
- };
- tools.loopShowTooltip(myChart, option, {
- interval: 2000,
- loopSeries: true,
- });
- myChart.setOption(option)
- },
- initChart5 () {
- let myChart = echarts.init(this.$refs['echart5'])
- let option = {
- tooltip: {
- formatter: data => {
- return `${data[0].name}<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[0].color.colorStops[0].color}"></span> ${data[0].seriesName}:${data[0].value}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[1].color.colorStops[0].color}"></span> ${data[1].seriesName}:${data[1].value}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[2].color.colorStops[0].color}"></span> ${data[2].seriesName}:${data[2].value}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[3].color.colorStops[0].color}"></span> ${data[3].seriesName}:${data[3].value}亿`
- },
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- }
- },
- grid: {
- top: '20%',
- right: '3%',
- left: '5%',
- bottom: '11%',
- },
- legend: {
- data: ["预算额", "合同额", "结算额", "支付额"],
- x: 'center',
- y: '0px',
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- xAxis: {
- data: ['设备费','设计费','施工费','材料费'],
- axisLine: {
- show: true, //隐藏X轴轴线
- lineStyle: {
- color: '#005094',
- width: 1,
- },
- },
- axisTick: {
- show: false, //隐藏X轴刻度
- },
- axisLabel: {
- show: true,
- // rotate: 40,
- textStyle: {
- color: '#fff',//'rgba(255,255,255,0.6)', //X轴文字颜色
- },
- },
- },
- yAxis: [
- {
- type: 'value',
- name: '亿元',
- nameTextStyle: {
- color: 'rgba(255,255,255,0.6)',
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#68b4dd66',
- type: 'dashed',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#3D7495',
- },
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: 'rgba(250,250,250,0.6)',
- },
- },
- },
- ],
- series: [
- {
- name: '预算额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#71D5FF',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart5.map(item => item.value),
- },
- {
- name: '合同额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#4D6FF6',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart5.map(item => item.value2),
- },
- {
- name: '结算额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#877CFC',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart5.map(item => item.value3),
- },
- {
- name: '支付额',
- type: 'bar',
- barWidth: 10,
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#52BF80',
- },
- {
- offset: 1,
- color: '#082550',
- },
- ]),
- },
- },
- data: echart5.map(item => item.value4),
- },
- ],
- }
- myChart.setOption(option)
- tools.loopShowTooltip(myChart, option, {
- interval: 2000,
- loopSeries: true,
- })
- },
- },
- })
|