Skip to content

Commit

Permalink
[@mantine/charts] Fix incorrect y-axis styles in RTL (#5505)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Jan 3, 2024
1 parent 3f92d8f commit 29eb1bd
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
9 changes: 8 additions & 1 deletion packages/@mantine/charts/src/AreaChart/AreaChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export const AreaChart = factory<AreaChartFactory>((_props, ref) => {
onMouseLeave,
orientation,
referenceLines,
dir,
...others
} = props;

Expand Down Expand Up @@ -296,7 +297,13 @@ export const AreaChart = factory<AreaChartFactory>((_props, ref) => {
});

return (
<Box ref={ref} {...getStyles('root')} onMouseLeave={handleMouseLeave} {...others}>
<Box
ref={ref}
{...getStyles('root')}
onMouseLeave={handleMouseLeave}
dir={dir || 'ltr'}
{...others}
>
<ResponsiveContainer {...getStyles('container')}>
<ReChartsAreaChart
data={data}
Expand Down
9 changes: 8 additions & 1 deletion packages/@mantine/charts/src/BarChart/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export const BarChart = factory<BarChartFactory>((_props, ref) => {
barChartProps,
type,
orientation,
dir,
...others
} = props;

Expand Down Expand Up @@ -205,7 +206,13 @@ export const BarChart = factory<BarChartFactory>((_props, ref) => {
});

return (
<Box ref={ref} {...getStyles('root')} onMouseLeave={handleMouseLeave} {...others}>
<Box
ref={ref}
{...getStyles('root')}
onMouseLeave={handleMouseLeave}
dir={dir || 'ltr'}
{...others}
>
<ResponsiveContainer {...getStyles('container')}>
<ReChartsBarChart
data={data}
Expand Down
9 changes: 8 additions & 1 deletion packages/@mantine/charts/src/LineChart/LineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export const LineChart = factory<LineChartFactory>((_props, ref) => {
fillOpacity,
curveType,
orientation,
dir,
...others
} = props;

Expand Down Expand Up @@ -235,7 +236,13 @@ export const LineChart = factory<LineChartFactory>((_props, ref) => {
});

return (
<Box ref={ref} {...getStyles('root')} onMouseLeave={handleMouseLeave} {...others}>
<Box
ref={ref}
{...getStyles('root')}
onMouseLeave={handleMouseLeave}
dir={dir || 'ltr'}
{...others}
>
<ResponsiveContainer {...getStyles('container')}>
<ReChartsLineChart data={data} layout={orientation} {...lineChartProps}>
{withLegend && (
Expand Down
2 changes: 1 addition & 1 deletion packages/@mantine/charts/src/Sparkline/Sparkline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const Sparkline = factory<SparklineFactory>((_props, ref) => {
const mappedData = useMemo(() => data.map((value, index) => ({ value, index })), [data]);

return (
<Box ref={ref} {...getStyles('root')} {...others}>
<Box ref={ref} {...getStyles('root')} {...others} dir="ltr">
<ResponsiveContainer>
<ReChartsAreaChart data={mappedData}>
<Area
Expand Down

0 comments on commit 29eb1bd

Please sign in to comment.