Y scale problem with values set and to ignore the scale generated from the received values. #11736
Replies: 4 comments 5 replies
-
Grazie a chi mi aiuterà |
Beta Was this translation helpful? Give feedback.
-
@paolodecaro the issue is how you are configuring Move y: {
display: true,
title: {
display: true,
text: "Number of Courses",
color: "red",
},
min: 0,
max: 650,
ticks: {
color: "orange",
font: { size: 12, weight: "bold" },
},
grid: {
display: true,
drawTicks: false,
},
}, Here a codepen how it works: https://codepen.io/stockinail/pen/WNWzpdZ Fammi sapere se funziona! |
Beta Was this translation helpful? Give feedback.
-
Hello and thanks again, I have this graph that receives data from a Mysql DB with a php program. I have the problem of defining the Y axis with a range from -10 to +100 degrees with steps of 2°. The program I emulated automatically calculates the Y axis values. Could you kindly help me so that the Y axis takes the range I want. Thank you ` <title>ChartJS - LineGraph</title> <style> .chart-container { width: 640px; height: auto; } </style>
}); ` Ecco il programma PHP ` |
Beta Was this translation helpful? Give feedback.
-
Hi here you are data extraction, you just need to take the last 10 rows of the DB. Each row of the DB records the date-time temperature of a sensor which is sent with the MQTT protocol to a Mysql DB. The graph reads the DB every 5 minutes and must update the graph. The X axis will be composed of the date-time to be positioned vertically and not obliquely, while the Y data will be the temperature. The Y axis header values must take those imposed by me. Thank you so much. |
Beta Was this translation helpful? Give feedback.
-
Good evening, I kindly ask you for a little help, I need to manually set the values for the Y axis scale. I don't want the values generated by Chart.js to scale, I set a range from 0 to 650, but Chart.js he ignores it and writes me the ones generated by him automatically based on the values received from the skier. I attach the code. Thanks in advance
<script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"> </script> <script src= "https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.1.2/chart.umd.js"> </script> <title>Bar Chart - Axes Styling</title>`
GeeksforGeeks
`
Beta Was this translation helpful? Give feedback.
All reactions