CN-65 feat: 流量曲线图、饼图、其他内容

This commit is contained in:
chenjinsong
2021-07-20 18:58:55 +08:00
parent d37f5ec1d0
commit 05178b25be
11 changed files with 105 additions and 58 deletions

View File

@@ -4,7 +4,7 @@
* @description chart option和一些工具
*/
import { format } from 'echarts'
import { shortFormatter, tooltipShortFormatter } from './chartFormatter'
import { shortFormatter, timeUnitFormatter } from './chart-formatter'
import _ from 'lodash'
export const chartColor = ['#5370C6', '#90CC74', '#FAC858', '#EE6666',
'#73BFDE', '#3BA172', '#FC8452', '#9960B4',
@@ -179,9 +179,7 @@ const lineStack = {
}
const pieWithTable = {
tooltip: {
appendToBody: true,
trigger: 'item',
formatter: tooltipShortFormatter
appendToBody: true
},
color: chartColor,
animation: false,
@@ -194,10 +192,10 @@ const pieWithTable = {
itemWidth: 10, // 设置宽度
itemHeight: 10, // 设置高度
itemGap: 20,
formatter: tooLongFormatter,
tooltip: {
show: true
},
formatter: tooLongFormatter
}
},
series: [
{
@@ -209,6 +207,11 @@ const pieWithTable = {
label: {
formatter: '{d}%'
},
tooltip: {
formatter: function (param, index, callback) {
return `${param.name}: ${shortFormatter(param.value)}`
}
},
emphasis: {
itemStyle: {
shadowBlur: 10,