Skip to content

Commit

Permalink
UI: fix show-in-order
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaAmega committed Jul 9, 2024
1 parent ab9ea17 commit fe96d20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface BigGraphWidgetProps extends AdditionalGraphInfo {

const BigGraphWidgetContent: React.FunctionComponent<BigGraphWidgetProps> = (props) => {
const viewParams = useDashboardViewParams()
const isHistogram = props.data.some(({ type }) => type === 'histogram')

return (
<div>
Expand All @@ -20,7 +21,7 @@ const BigGraphWidgetContent: React.FunctionComponent<BigGraphWidgetProps> = (pro
title: undefined,
xaxis: {
...props.layout?.xaxis,
type: viewParams?.isXaxisAsCategorical ? 'category' : undefined
type: viewParams?.isXaxisAsCategorical && !isHistogram ? 'category' : undefined
}
}}
config={{ responsive: true }}
Expand Down
4 changes: 3 additions & 1 deletion ui/packages/evidently-ui-lib/src/widgets/RichDataWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const RichDataWidget: React.FunctionComponent<RichDataParams & { widgetSize: num
) => {
const [details, setDetails] = useState<boolean>(false)
const viewParams = useDashboardViewParams()
const isHistogram = props.graph?.data.some(({ type }) => type === 'histogram')

return (
<React.Fragment>
<Grid container spacing={2} justifyContent="center" alignItems="center">
Expand Down Expand Up @@ -66,7 +68,7 @@ const RichDataWidget: React.FunctionComponent<RichDataParams & { widgetSize: num
title: undefined,
xaxis: {
...props.graph.layout?.xaxis,
type: viewParams?.isXaxisAsCategorical ? 'category' : undefined
type: viewParams?.isXaxisAsCategorical && !isHistogram ? 'category' : undefined
}
}}
config={{ responsive: true }}
Expand Down

0 comments on commit fe96d20

Please sign in to comment.