mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(chart): enable cross-filter on bar charts without dimensions (#37407)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -89,6 +89,34 @@ describe('transformSeries', () => {
|
||||
expect((result as any).itemStyle.borderType).toBeUndefined();
|
||||
expect((result as any).itemStyle.borderColor).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should dim series when selectedValues does not include series name (dimension-based filtering)', () => {
|
||||
const opts = {
|
||||
filterState: { selectedValues: ['other-series'] },
|
||||
hasDimensions: true,
|
||||
seriesType: EchartsTimeseriesSeriesType.Bar,
|
||||
timeShiftColor: false,
|
||||
};
|
||||
|
||||
const result = transformSeries(series, mockColorScale, 'test-key', opts);
|
||||
|
||||
// OpacityEnum.SemiTransparent = 0.3
|
||||
expect((result as any).itemStyle.opacity).toBe(0.3);
|
||||
});
|
||||
|
||||
it('should not dim series when hasDimensions is false (X-axis cross-filtering)', () => {
|
||||
const opts = {
|
||||
filterState: { selectedValues: ['Product A'] },
|
||||
hasDimensions: false,
|
||||
seriesType: EchartsTimeseriesSeriesType.Bar,
|
||||
timeShiftColor: false,
|
||||
};
|
||||
|
||||
const result = transformSeries(series, mockColorScale, 'test-key', opts);
|
||||
|
||||
// OpacityEnum.NonTransparent = 1 (not dimmed)
|
||||
expect((result as any).itemStyle.opacity).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('transformNegativeLabelsPosition', () => {
|
||||
|
||||
Reference in New Issue
Block a user