// 曲线 export let line = (xAxisVal:any[], seriesVal:any[]) => { return { tooltip: { trigger: 'axis', axisPointer: { type: 'line', lineStyle: { width: 1 } } }, legend: { right: '0%', top: 0, textStyle: { color: '#C1DFFF', fontSize: 12, lineHeight: 14, borderRadius: 7 }, itemWidth: 6, itemHeight: 6, itemGap: 6, data: (() => { let legendData:any[] = [] seriesVal.forEach(item => { legendData.push({ name: item.name, icon: 'circle', textStyle: { color: '#C1DFFF', fontSize: 12, lineHeight: 14 } }) }) return legendData })() }, grid: { top: 20, left: '3%', right: '0%', bottom: '1%', containLabel: true }, xAxis: [{ type: 'category', boundaryGap: false, axisTick: { show: false }, axisLine: { show: false, lineStyle: { color: '#78acd0', opacity: 0.2 } }, axisLabel: { color: '#C1DFFF', rotate: 60, fontSize: 12 }, data: xAxisVal }], yAxis: [{ type: 'value', splitLine: { show: true, lineStyle: { color: '#2B5072', opacity: 0.6, type: 'dashed' } }, splitNumber: 5, axisTick: { show: false }, axisLine: { show: false }, axisLabel: { color: '#C1DFFF', fontSize: 12 } }], series: (() => { let tempArr:any[] = [] seriesVal.forEach((item, i) => { tempArr.push({ type: 'line', name: item.name, smooth: true, showSymbol: false, symbol: 'circle', lineStyle: { normal: { width: 1 } }, itemStyle: { normal: {} }, data: item.value }) }) return tempArr })() } } export let barPlane = { dataset: { source: [ ['product', null], ['Oracle12', 88], ['Oracle02', 72], ['Oracle08', 74], ['mySql181', 71], ['mySql20', 63] ] }, tooltip: { show: true }, grid: { top: '15%', left: '3%', right: '5%', bottom: '3%', containLabel: true }, yAxis: [{ type: 'category', data: ['Oracle12', 'Oracle02', 'Oracle08', 'mySql181', 'mySql20'], inverse: true, splitLine: { show: false }, axisTick: { show: false }, axisLine: { show: false }, axisLabel: { textStyle: { align: 'right', fontSize: 14, color: '#72b9df', padding: [0, 10, 0, 0], fontFamily: 'Microsoft YaHei', fontStyle: 'italic' } } }], xAxis: [{ type: 'value', splitLine: { show: false }, axisTick: { show: false }, axisLine: { show: false }, axisLabel: { textStyle: { fontSize: 16, color: '#72b9df' } } }], series: [ { // For shadow type: 'bar', itemStyle: { normal: { color: 'rgba(34, 58, 180, .32)', barBorderRadius: 40 } }, tooltip: { show: false }, barGap: '-100%', barWidth: '25%', // barCategoryGap: '40%', animationDelay: function (idx:number) { return idx * 10 + 100 } }, { name: '', type: 'bar', barWidth: '25%', itemStyle: { normal: { color: { type: 'linear', x: 0, y: 0, x2: 1, y2: 1, colorStops: [{ offset: 0, color: 'rgb(12, 177, 246)' }, { offset: 0.7, color: 'rgb(159, 124, 247)' }, { offset: 1, color: 'rgb(208, 99, 241)' }], globalCoord: false }, barBorderRadius: 30 } }, animationDelay: function (idx:number) { return idx * 100 } }], animationEasing: 'elasticOut', animationDelayUpdate: function (idx:number) { return idx * 100 } } export let testData = { dataX: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期七'], dataList: [ { name: 'bar1', data: [68, 79, 55, 23, 90, 88, 77] }, { name: 'bar2', data: [88, 66, 89, 66, 77, 33, 99] } ] } export let barPlaneData = { dataX: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期七'], dataList: [ { name: 'bar1', data: [68, 79, 55, 23, 90, 88, 77] } ] } export let pieData = { dataList: [ { name: 'pie1', value: 30 }, { name: 'pie2', value: 40 }, { name: 'pie3', value: 55 }, { name: 'pie4', value: 66 } ] }