0

I'm quite new with the NVD3 library. I have a linechart with a simple tooltip. I activated the footer and I would like to load in the footer a different value for every couple (x,y).

What is the best solution in NVD3?

I was trying to insert in the json file another attribute with the z value.

Json:

[
  {
    "key": "Marketable",
    "color": "#A09FA2",
    "area" : "false",
    "values": [
      {
        "x": 1,
        "y": 5220593,
        "z": 5220593
      },
      {
        "x": 2,
        "y": 5220593,
        "z": 5220593
      },
...

And in the library I would like to use the z value, is it possible ?

Below here the code:

       var contentGenerator = function(d) {
            if (content != null) {
                return content;
            }

            if (d == null) {
                return '';
            }

            var table = d3.select(document.createElement("table"));
            var theadEnter = table.selectAll("thead")
                .data([d])
                .enter().append("thead");
            theadEnter.append("tr")
                .append("td")
                .attr("colspan",3)
                .append("strong")
                .classed("x-value",true)
                .html(headerFormatter("Round "+d.value+", ratio "+{***here I would like to take the z value***}.value+"%"));
Silvio S.
  • 547
  • 5
  • 20
  • 1
    If you're going to post that large a code dump, you might as well create a stack snippet. – royhowie Jun 12 '15 at 08:30
  • http://jsfiddle.net/silviosangineto/2q7tv7L5/14/ – Silvio S. Jun 12 '15 at 09:04
  • You can make a jsfiddle-esque insertion in your post. When editing, search for the stack snippet (it's a page with the `<>` brackets) button. (jsfiddle links can die; the stack snippet will stay with the post 5ever) – royhowie Jun 12 '15 at 09:06
  • I edited my original post. Now, I hope that it will be more clear. – Silvio S. Jun 12 '15 at 14:42

0 Answers0