Thanks, I got that to work but I can’t seem to get the base64 data uri image on page1 to show on page2 (to carry it over as an image). Do you think you could output it as a .png instead so I could just use some code like <img src="/file.png" /> on page2 to display it?
<img src="/file.png" />
Hi, thanks for responding. As I wrote up the sample code I noticed the interval was set to day. I change it from day to year, so I did this:
intervalType: "year",
And it fixed the issue! I guess when it was going through all the years by day it slowed it down? Now that it’s set to year it goes through it quickly! Thanks.
Hi, thanks so much for that. I haven’t tried it yet but I want to link users to a specific point on the chart and have the coordinates listed in the URL. I’d also like the URL to dynamically change based on where the pointer is on the chart. Is that possible? I’ll give your code a whirl this week. Thanks!
I’m so dumb, I figured it out. To do this, just set the visibility to false for the line you want hidden, like this:
visible: false,
Then, setup a click event handler so you can turn the line ‘on’ when it’s clicked in the legend.
legend: { cursor: "pointer", itemclick: function (e) { //console.log("legend click: " + e.dataPointIndex); //console.log(e); if (typeof (e.dataSeries.visible) === "undefined" || e.dataSeries.visible) { e.dataSeries.visible = false; } else { e.dataSeries.visible = true; } e.chart.render(); } },
References: https://canvasjs.com/docs/charts/chart-options/data/visible/ https://canvasjs.com/docs/charts/how-to/hide-unhide-data-series-chart-legend-click/