Skip to content

Commit

Permalink
Merge pull request #2810 from VisActor/2178-bug-pivotchart-pie-select…
Browse files Browse the repository at this point in the history
…ed-selected_reverse

2178 bug pivotchart pie selected selected reverse
  • Loading branch information
fangsmile authored Nov 14, 2024
2 parents e468f4b + 475cb49 commit e8e56ca
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: pivot chart pie type selected state not work #2178\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: rose pivotchart click legend then hover chart render error #2209\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "[email protected]"
}
6 changes: 6 additions & 0 deletions packages/vtable/src/PivotChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,12 @@ export class PivotChart extends BaseTable implements PivotChartAPI {
delete spec.area.state.selected;
delete spec.area.state.selected_reverse;
}
if (spec.pie?.state?.selected) {
spec.pie.state.vtable_selected = spec.pie.state.selected;
spec.pie.state.vtable_selected_reverse = spec.pie.state.selected_reverse;
delete spec.pie.state.selected;
delete spec.pie.state.selected_reverse;
}
};
this.internalProps.indicators?.forEach((indicator: string | IIndicator) => {
if ((indicator as IChartColumnIndicator).chartSpec) {
Expand Down
9 changes: 6 additions & 3 deletions packages/vtable/src/scenegraph/refresh-node/update-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,13 @@ export function updateChartData(scenegraph: Scenegraph) {
cellNode.children.forEach((node: Chart) => {
if ((node as any).type === 'chart') {
node.updateData(table.getCellValue(col, row));
const newAxes = table.internalProps.layoutMap.getChartAxes(col, row);
node.setAttribute('axes', newAxes);
const chartSpec = node.attribute.spec;
chartSpec.axes = newAxes;
const chartType = chartSpec.type;
if (chartType !== 'gauge' && chartType !== 'rose' && chartType !== 'radar') {
const newAxes = table.internalProps.layoutMap.getChartAxes(col, row);
node.setAttribute('axes', newAxes);
chartSpec.axes = newAxes;
}
node.setAttribute('spec', chartSpec);
// node.addUpdateBoundTag();
}
Expand Down

0 comments on commit e8e56ca

Please sign in to comment.