bito-code-review[bot] commented on code in PR #37181:
URL: https://github.com/apache/superset/pull/37181#discussion_r2696160015
##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts:
##########
@@ -190,3 +194,46 @@ describe('transformNegativeLabelsPosition', () => {
expect((result as any)[4].label).toBe(undefined);
});
});
+
+test('should configure time axis labels to show max label for last month
visibility', () => {
+ const formData = {
+ colorScheme: 'bnbColors',
+ datasource: '3__table',
+ granularity_sqla: 'ds',
+ metric: 'sum__num',
+ viz_type: 'my_viz',
+ };
+ const queriesData = [
+ {
+ data: [
+ { sum__num: 100, __timestamp: new Date('2026-01-01').getTime() },
+ { sum__num: 200, __timestamp: new Date('2026-02-01').getTime() },
+ { sum__num: 300, __timestamp: new Date('2026-03-01').getTime() },
+ { sum__num: 400, __timestamp: new Date('2026-04-01').getTime() },
+ { sum__num: 500, __timestamp: new Date('2026-05-01').getTime() },
+ ],
+ colnames: ['sum__num', '__timestamp'],
+ coltypes: [GenericDataType.Numeric, GenericDataType.Temporal],
+ },
+ ];
+ const chartProps = new ChartProps({
+ formData,
+ width: 800,
+ height: 600,
+ queriesData,
+ theme: supersetTheme,
+ });
+
+ const result = transformProps(
+ chartProps as unknown as EchartsTimeseriesChartProps,
+ );
+
+ expect(result.echartOptions.xAxis).toEqual(
+ expect.objectContaining({
+ axisLabel: expect.objectContaining({
+ showMaxLabel: true,
+ alignMaxLabel: 'right',
+ }),
+ }),
+ );
+});
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Test setup incomplete for temporal axis</b></div>
<div id="fix">
Add xAxis: '__timestamp' to the formData object to ensure the axis is
treated as time-based without removing viz_type.
</div>
</div>
<small><i>Code Review Run #d52268</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]