-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[charts] LinePlot does not allow to use scaleType 'points' #14585
Comments
Hi @mircowidmer, it seems you are using composition. You can read more about it here: https://mui.com/x/react-charts/composition/ When using import { LinePlot, ResponsiveChartContainer } from "@mui/x-charts";
import * as React from "react";
export default function BasicLineChart() {
return (
<ResponsiveChartContainer
height={300}
width={500}
series={[
{
type: "line",
data: [2, 5.5, 2, 8.5, 1.5, 5],
},
]}
xAxis={[
{
scaleType: "point",
data: [1, 2, 3, 5, 8, 10],
},
]}
>
<LinePlot />
</ResponsiveChartContainer>
);
} You can see it in action on this sandbox: https://codesandbox.io/p/sandbox/friendly-wing-tk8k95?file=%2Fsrc%2FDemo.tsx |
@JCQuintas Thank you for your comment. I‘ll check it first thing tomorrow and see if I‘ll get your suggestion to work. |
@mircowidmer can you provide a codesandbox with the current issue? It appears that it arrises from your specific implementation details, and without further information it is a bit hard to help you. |
I have a working example here: https://codesandbox.io/p/sandbox/trusting-bhaskara-l863z2 If I change line 82 to |
You need to make your sandbox public :) |
Is it accessible now? |
@mircowidmer yeah it works So for scales of type {
id: "turnover",
scaleType: "point",
reverse: true,
data: data
.map((premiumTurnover: any) => premiumTurnover.TURNOVER),
}, As for the "circles", you can use And also in the source code:
|
|
Glad to have helped 😄 It is always good to read the source code in these composition cases, because most of the times we use the same APIs. I'll be closing this issue now, feel free to open a new one if you encounter a bug or issue 👍 |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note We value your feedback @mircowidmer! How was your experience with our support team? |
Summary
When I use
LineChart
, using thescaleType
point
works as expected:When I use the
LinePlot
in a combined setup, I have no way of setting thescaleType
topoint
.See: https://mui.com/x/api/charts/axis-config/#axis-config-prop-scaleType
Examples
No response
Motivation
No response
Search keywords: LinePlot ScaleType
The text was updated successfully, but these errors were encountered: