snippins opened a new issue, #30282:
URL: https://github.com/apache/superset/issues/30282
### Bug description
This is due to the snippet of code here in customControls.tsx
```
export const xAxisForceCategoricalControl = {
name: 'xAxisForceCategorical',
config: {
type: 'CheckboxControl',
label: () => t('Force categorical'),
default: false,
description: t('Treat values as categorical.'),
initialValue: (control: ControlState, state: ControlPanelState | null) =>
state?.form_data?.x_axis_sort !== undefined || control.value,
renderTrigger: true,
visibility: ({ controls }: { controls: ControlStateMapping }) =>
checkColumnType(
getColumnLabel(controls?.x_axis?.value as QueryFormColumn),
controls?.datasource?.datasource,
[GenericDataType.Numeric],
),
shouldMapStateToProps: () => true,
},
};
```
It seems that for bar chart we need to check the type of the y_axis instead?
### How to reproduce the bug
- Create a bar chart with the x axis of type var_string (varchar in
starrocks) and y axis of a numeric type.
=> the xAxisForceCategoricalControl got hidden.
If I cast the x axis to int for example then the control is shown, but that
does not make much sense as we are trying to sort the value of the y axis.
This is probably a related report, but mine seems like a more accurate
description of the bug, but I don't really know why they're able to work around
using the string datatype, as it is not a numeric type as in the visibility
check.
https://github.com/apache/superset/issues/30238
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [X] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [X] I have searched the GitHub issue tracker and didn't find a similar bug
report.
- [X] I have checked Superset's logs for errors and if I found a relevant
Python stacktrace, I included it here as text in the "additional context"
section.
--
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]