Skip to content

Commit

Permalink
Merge pull request #2021 from VisActor/2017-bug-pivot-chart-selectState
Browse files Browse the repository at this point in the history
2017 bug pivot chart select state
  • Loading branch information
fangsmile committed Jul 4, 2024
2 parents 98b2cc7 + 0fd92e6 commit ad6cb82
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: pivot chart select state #2017\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "[email protected]"
}
8 changes: 4 additions & 4 deletions packages/vtable/src/layout/pivot-header-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3159,7 +3159,7 @@ export class PivotHeaderLayoutMap implements LayoutMapAPI {
if ((this._table as PivotChart)._selectedDataItemsInChart.length >= 1) {
const match = (this._table as PivotChart)._selectedDataItemsInChart.find(item => {
for (const itemKey in item) {
if (item[itemKey] !== datum[itemKey]) {
if (typeof item[itemKey] !== 'object' && item[itemKey] !== datum[itemKey]) {
return false;
}
}
Expand All @@ -3169,7 +3169,7 @@ export class PivotHeaderLayoutMap implements LayoutMapAPI {
} else if ((this._table as PivotChart)._selectedDimensionInChart?.length) {
// 判断维度点击
const match = (this._table as PivotChart)._selectedDimensionInChart.every(item => {
if (datum[item.key] !== item.value) {
if (typeof item.value !== 'object' && datum[item.key] !== item.value) {
return false;
}
return true;
Expand All @@ -3184,7 +3184,7 @@ export class PivotHeaderLayoutMap implements LayoutMapAPI {
if ((this._table as PivotChart)._selectedDataItemsInChart.length >= 1) {
const match = (this._table as PivotChart)._selectedDataItemsInChart.find(item => {
for (const itemKey in item) {
if (item[itemKey] !== datum[itemKey]) {
if (typeof item[itemKey] !== 'object' && item[itemKey] !== datum[itemKey]) {
return false;
}
}
Expand All @@ -3194,7 +3194,7 @@ export class PivotHeaderLayoutMap implements LayoutMapAPI {
} else if ((this._table as PivotChart)._selectedDimensionInChart?.length) {
// 判断维度点击
const match = (this._table as PivotChart)._selectedDimensionInChart.every(item => {
if (datum[item.key] !== item.value) {
if (typeof item.value !== 'object' && datum[item.key] !== item.value) {
return false;
}
return true;
Expand Down

0 comments on commit ad6cb82

Please sign in to comment.