chart-tool icon indicating copy to clipboard operation
chart-tool copied to clipboard

Error: <text> attribute y: Expected length, "NaN"

Open abrambailey opened this issue 4 years ago • 3 comments

I'm having this issue:

image

I had the same issue with the older version, but just installed to 1.4.2 and same issue. It leads to console errors anywhere I embed the chart, and even seeing the console errors inside of the chart builder interface itself.

abrambailey avatar Jun 02 '20 18:06 abrambailey

Thanks @abrambailey. Can you send me the data you're using? Want to try and replicate this. No idea what specifically is causing this… seems it could be the tooltips based on the element.

tomcardoso avatar Jun 02 '20 18:06 tomcardoso

Here's the data:

<!-- CHART TOOL v1.4.2-0 -->
<!-- edited: Tue Jun 02 2020 13:46:02 GMT-0500 (Central Daylight Time) -->
<!-- slug: Test123 -->
<div class="ct-chart" data-chartid="ct-xrsZ9KGvvXJC3w2Rn">
  <script type="text/javascript">
    (function(root) {
      var data = {
  "version": "1.4.2",
  "id": "xrsZ9KGvvXJC3w2Rn",
  "heading": "",
  "qualifier": "",
  "source": "HEARING TRACKER",
  "tags": [],
  "chart": {
    "class": "primary",
    "hasHours": false,
    "data": "type, number\na,1\nb,2\nc,3",
    "options": {
      "annotations": true,
      "expanded": false,
      "footer": true,
      "head": true,
      "indexed": false,
      "interpolation": false,
      "legend": true,
      "qualifier": true,
      "share_data": true,
      "stacked": false,
      "tips": true,
      "type": "bar",
      "x_axis": true,
      "y_axis": true
    },
    "x_axis": {
      "display": true,
      "scale": "linear",
      "ticks": "auto",
      "orient": "bottom",
      "format": "comma",
      "nice": false
    },
    "y_axis": {
      "display": true,
      "scale": "ordinal",
      "ticks": "auto",
      "orient": "right",
      "format": "comma",
      "nice": false
    },
    "annotations": {
      "highlight": [],
      "range": [],
      "text": [],
      "pointer": []
    }
  }
};
      root.ChartTool = root.ChartTool || [];
      root.ChartTool.push({id: "ct-" + data.id, data: data});
      var b = document.getElementsByTagName("body")[0];
      if (!b.classList.contains("ct-charttool-init")) {
        b.classList.add("ct-charttool-init");
        var c = document.createElement("link");
        var j = document.createElement("script");
        c.href = "https://charts.hearingtracker.com/1.4.2/chart-tool.min.css?token=0"; c.rel = "stylesheet";
        j.src = "https://charts.hearingtracker.com/1.4.2/chart-tool.min.js?token=0"; j.async = true; j.defer = true;
        document.getElementsByTagName("head")[0].appendChild(c);
        document.getElementsByTagName("head")[0].appendChild(j);
      }
    })(this);
  </script>
</div>

abrambailey avatar Jun 02 '20 18:06 abrambailey

Odd, I can't replicate this. Can you try this while running the master branch in development?

tomcardoso avatar Jun 02 '20 19:06 tomcardoso