diff --git a/api/package.json b/api/package.json index 5fc15a819..2bc0c8400 100644 --- a/api/package.json +++ b/api/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/api", - "version": "14.3.1", + "version": "14.3.2", "description": "", "main": "index.js", "scripts": { diff --git a/dashboard/package.json b/dashboard/package.json index d6b301265..0336532d8 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/dashboard", - "version": "14.3.1", + "version": "14.3.2", "license": "Apache-2.0", "publishConfig": { "access": "public", diff --git a/dashboard/src/components/plugins/viz-components/pie-chart/option/index.ts b/dashboard/src/components/plugins/viz-components/pie-chart/option/index.ts index 7c616abc9..1863f21ff 100644 --- a/dashboard/src/components/plugins/viz-components/pie-chart/option/index.ts +++ b/dashboard/src/components/plugins/viz-components/pie-chart/option/index.ts @@ -1,10 +1,11 @@ import { defaultEchartsOptions } from '~/styles/default-echarts-options'; import { IPieChartConf } from '../type'; import { getSeries } from './series'; +import { getTooltip } from './tooltip'; export function getOption(conf: IPieChartConf, data: TPanelData, width: number) { return { - tooltip: defaultEchartsOptions.getTooltip({}), + tooltip: getTooltip(), series: getSeries(conf, data, width), }; } diff --git a/dashboard/src/components/plugins/viz-components/pie-chart/option/tooltip.ts b/dashboard/src/components/plugins/viz-components/pie-chart/option/tooltip.ts new file mode 100644 index 000000000..aad33ba15 --- /dev/null +++ b/dashboard/src/components/plugins/viz-components/pie-chart/option/tooltip.ts @@ -0,0 +1,33 @@ +import { defaultEchartsOptions } from '~/styles/default-echarts-options'; + +function getFormatter() { + return ({ name, value, color }: any) => { + const template = ` + + + +
+
+ + + + + + + +
${name}${value}
+ `; + + return template; + }; +} + +export function getTooltip() { + return defaultEchartsOptions.getTooltip({ + trigger: 'item', + formatter: getFormatter(), + }); +} diff --git a/package.json b/package.json index 2e84988a4..5ae083ace 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/root", - "version": "14.3.1", + "version": "14.3.2", "private": true, "workspaces": [ "api", diff --git a/settings-form/package.json b/settings-form/package.json index c22de5e1e..345ebf9b4 100644 --- a/settings-form/package.json +++ b/settings-form/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/settings-form", - "version": "14.3.1", + "version": "14.3.2", "license": "Apache-2.0", "publishConfig": { "access": "public", diff --git a/website/package.json b/website/package.json index b343cff04..0294c69d0 100644 --- a/website/package.json +++ b/website/package.json @@ -2,7 +2,7 @@ "name": "@devtable/website", "private": true, "license": "Apache-2.0", - "version": "14.3.1", + "version": "14.3.2", "scripts": { "dev": "vite", "preview": "vite preview"