fix(web): fix line chart using interval field as xAxis & fix pie chart tooltip (#1697)

This commit is contained in:
chenluli
2024-07-17 16:40:42 +08:00
committed by GitHub
parent 1775b87606
commit 083becde08
4 changed files with 18 additions and 7 deletions

View File

@@ -102,6 +102,10 @@ export const AutoChart = (props: AutoChartProps) => {
spec.data = sortData({ data: spec.data, xField: dataAnalyzerOutput.dataProps?.find(field => field.recommendation === 'date'), chartType: chartTypeInput });
}
}
if (chartTypeInput === 'pie_chart' && spec?.encode?.color) {
// 补充饼图的 tooltip title 展示
spec.tooltip = { title: { field: spec.encode.color } }
}
return (
<Chart
key={chartTypeInput}