From 34cc48cc898da17729a738954b8d3db1d07e232f Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 6 Jul 2021 15:57:27 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=20chartp-line=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20tooltip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/charts/chart-options.js | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/components/charts/chart-options.js b/src/components/charts/chart-options.js index 7a33d9da..3e4e25f6 100644 --- a/src/components/charts/chart-options.js +++ b/src/components/charts/chart-options.js @@ -7,6 +7,17 @@ import { format } from 'echarts' import _ from 'lodash' const line = { + tooltip: { + appendToBody: true, + trigger: 'axis', + textStyle: { + width: 20, + overflow: 'truncate' + }, + // formatter: () =>{ + // return '1' + // } + }, xAxis: { type: 'time' }, @@ -47,6 +58,17 @@ const line = { ] } const lineWithStatistics = { + tooltip: { + appendToBody: true, + trigger: 'axis', + textStyle: { + width: 20, + overflow: 'truncate' + }, + // formatter: () =>{ + // return '1' + // } + }, xAxis: { type: 'time' }, @@ -76,6 +98,17 @@ const lineWithStatistics = { ] } const lineStack = { + tooltip: { + appendToBody: true, + trigger: 'axis', + textStyle: { + width: 20, + overflow: 'truncate' + }, + // formatter: () =>{ + // return '1' + // } + }, xAxis: { type: 'time' }, @@ -118,6 +151,7 @@ const lineStack = { } const pieWithTable = { tooltip: { + appendToBody: true, trigger: 'item' }, animation: false, @@ -243,3 +277,6 @@ export function getLayout (type) { function tooLongFormatter (name) { return format.truncateText(name, 110, '12') } +// function axiosFormatter(params) { +// +// }