Chart.js - year independent x-axis - Druckversion +- Javascript-forum (https://javascript-forum.de) +-- Forum: Entwicklung (https://javascript-forum.de/forumdisplay.php?fid=4) +--- Forum: Javascript (https://javascript-forum.de/forumdisplay.php?fid=6) +--- Thema: Chart.js - year independent x-axis (/showthread.php?tid=2249) |
Chart.js - year independent x-axis - ludwigmller - 22.03.2023 I have data for several years, that should be plotted in a line graph. Data example: Code: date season cum_sum As you see in the attached image, the x-axis is not chronological. Days of the season 2023, that were not part of the season 2022, are plotted at the end of the x-axis. E.g.: data_2022 = ["01-03", 5], ["01-10", 15] data_2023 = ["01-03", 10], ["01-05",20] --> 01/05 is plotted on the end of the x-axis. Here my current JS-Code: Code: var ctx = document.getElementById('myChart').getContext('2d'); |