fix(echarts): adaptive formatting labels (#38017)

This commit is contained in:
Mehmet Salih Yavuz
2026-03-04 22:26:18 +03:00
committed by GitHub
parent 796c206ee7
commit 63e7ee70bf
4 changed files with 252 additions and 23 deletions

View File

@@ -76,7 +76,7 @@ describe('Scatter Chart X-axis Time Formatting', () => {
expect(transformedProps.echartOptions.xAxis).toHaveProperty('axisLabel');
const xAxis = transformedProps.echartOptions.xAxis as any;
expect(xAxis.axisLabel).toHaveProperty('formatter');
expect(xAxis.axisLabel.formatter).toBeUndefined();
expect(typeof xAxis.axisLabel.formatter).toBe('function');
});
test.each(D3_TIME_FORMAT_OPTIONS.map(([id]) => id))(
@@ -96,10 +96,8 @@ describe('Scatter Chart X-axis Time Formatting', () => {
const xAxis = transformedProps.echartOptions.xAxis as any;
expect(xAxis.axisLabel).toHaveProperty('formatter');
if (format === SMART_DATE_ID) {
expect(xAxis.axisLabel.formatter).toBeUndefined();
} else {
expect(typeof xAxis.axisLabel.formatter).toBe('function');
expect(typeof xAxis.axisLabel.formatter).toBe('function');
if (format !== SMART_DATE_ID) {
expect(xAxis.axisLabel.formatter.id).toBe(format);
}
},