I'm trying to make a line graph with data from a mySQL database. I refresh the page every 10 minutes automatically with new data, now the values on the y-axis are based on the data and can change over time when the data changes. I would like the y-axis with a standard minimum of 0 and a maximum of 100. I tried to introduce more options, but I don't get it to work.
<canvas id="c" width="500" height="500">grafiek kan niet laden</canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
<script>
var ctx = document.getElementById("c").getContext("2d");
var data = {
labels: ["Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag", "Zondag"],
datasets: [
{
fillColor: "#ffccef", // kleur onder de lijn
strokeColor: "rgba(250,127,163,1)", // lijn kleur
pointColor: "rgba(200,100,150,1)", // puntjes op grafiek
pointStrokeColor: "#fff",
data: RH1
},
{
fillColor: "#ffb3b3", // kleur onder de lijn
strokeColor: "rgba(255,127,163,1)", // lijn kleur
pointColor: "rgba(800,10,10,1)", // puntjes op grafiek
pointStrokeColor: "#fff",
data: temp1
}
]
};
var MyNewChart = new Chart(ctx).Line(data);
</script>