Copilot commented on code in PR #37457:
URL: https://github.com/apache/superset/pull/37457#discussion_r2733347035
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx:
##########
@@ -243,10 +243,10 @@ function createAxisControl(axis: 'x' | 'y'):
ControlSetRow[] {
name: 'truncateYAxis',
config: {
type: 'CheckboxControl',
- label: t('Truncate Axis'),
+ label: t('Truncate Y Axis'),
default: truncateYAxis,
renderTrigger: true,
- description: t('It’s not recommended to truncate axis in Bar
chart.'),
+ description: t('It’s not recommended to truncate Y axis in Bar
chart.'),
Review Comment:
In this bar chart control panel, `truncateYAxis` is used as the “value axis
truncation” flag and the axis configs are swapped when `orientation ===
Horizontal` (see `Timeseries/transformProps.ts` where `[xAxis, yAxis] = [yAxis,
xAxis]`). Because of that, this checkbox is visible under the **X Axis**
section for horizontal bars (via the `visibility` callback) and effectively
truncates the rendered X axis, not Y. Hardcoding the label/description to “Y
Axis” will be misleading in horizontal orientation. Consider making the
label/description orientation-aware (e.g., show “Truncate X Axis” when
horizontal and “Truncate Y Axis” when vertical) or using an
orientation-agnostic term like “Truncate value axis” to stay accurate in both
modes.
--
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]