Forum Replies Created by davidr

Viewing 4 posts - 1 through 4 (of 4 total)
  • in reply to: How to display chart as a static image (png, jpg) #16004

    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?

    • This reply was modified 7 years, 3 months ago by davidr. Reason: fixed showing code

    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.

    • This reply was modified 7 years, 7 months ago by davidr.
    in reply to: How to link (with URL) to a specific point in the chart? #14830

    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!

    in reply to: How to disable one line in a multiline line chart #14154

    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/

    • This reply was modified 7 years, 10 months ago by davidr.
    • This reply was modified 7 years, 10 months ago by davidr.
Viewing 4 posts - 1 through 4 (of 4 total)