Skip to content
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

Unable to change scale using min/max in options #168

Closed
Duberry opened this issue May 19, 2023 · 1 comment
Closed

Unable to change scale using min/max in options #168

Duberry opened this issue May 19, 2023 · 1 comment

Comments

@Duberry
Copy link

Duberry commented May 19, 2023

Simple issue - I can't influence scale min:max via config options.

I've had a look in chart.js. I can see that there is some logic that impacts scale options if they are not set. I can't see any obvious reasons why it would be causing issues for me.

I've confirmed that the example works with vanilla chart.js.

The expected behaviour is a Y axis with a scale from 0 to 5. The actual result is a Y axis with a scale from 2 to 5.

{ type: "bar", data: { labels: ["Context Awareness","Self Awareness"], datasets: [{ label: "Self Rating", data: [3,3.6], backgroundColor: ['#547654','#432343'], }, { label: "Average Rating (All Users)", data: [2.5,2.6], backgroundColor: '#000000', }, { label: "Research Validated Benchmark", data: [[4,5],[2.3,3.2]], backgroundColor: '#000000', }, ] }, options: { elements: { rectangle: { borderWidth: 2, }, }, responsive: true, legend: { position: "right", }, title: { display: true, text: "Chart.js Horizontal Bar Chart", }, scales: { y: { min: 0, max: 5, }, }, }, };

@Duberry Duberry closed this as completed May 19, 2023
@Duberry
Copy link
Author

Duberry commented May 19, 2023

RTFM'd. https://quickchart.io/documentation/reference/axes/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant