Issue with Google Visualisation API's "Line Chart" rendering cells having identical data for different entities.

27 views
Skip to first unread message

Jignesh

unread,
May 31, 2012, 7:13:11 AM5/31/12
to google-visua...@googlegroups.com
Hi,

I am facing an issue with Google Visualisation API's "Line Chart" rendering cells having identical data for different entities.


Code snippet copied from https://code.google.com/apis/ajax/playground/?type=visualization#line_chart

        function drawVisualization() {
          // Create and populate the data table.
          var data = google.visualization.arrayToDataTable([
            ['x', 'Cats', 'Blanket 1', 'Blanket 2'],
            ['A',   1,       1,           0.5],
            ['B',   2,       0.5,         1],
            ['C',   4,       1,           0.5],
            ['D',   8,       0.5,         1],
            ['E',   7,       1,           0.5],
            ['F',   7,       0.5,         1],
            ['G',   1,       8,           0.5],
            ['H',   4,       0.5,         1],
            ['I',   2,       1,           0.5],
            ['J',   3.5,     0.5,         1],
            ['K',   3,       1,           0.5],
            ['L',   3.5,     0.5,         1],
            ['M',   1,       1,           0.5],
            ['N',   1,       0.5,         1]
          ]);

          // Create and draw the visualization.
          new google.visualization.LineChart(document.getElementById('visualization')).
              draw(data, {curveType: "function",
                          width: 500, height: 400,
                          vAxis: {maxValue: 10}}
                  );
        }


The data table above shows following entry:

    ['A',   1,       1,    0.5]

Note the 'Cats', 'Blanket 1' columns have identical values.

On the generated chart I can see the values for 'Blanket 1' and 'Blanket 2' by hovering on the Y-axis data.Screenshots attached.
However for 'Cats' the value cannot be seen.It has a value 1.

Is this a bug in the API or some configuration is missing to display the data for all the entities even though the data is identical?
Above scenario creates a confusion when trying to visualise the entities data on chart.In above case it looks "Cats" have its value 0 at 'A'.

Thanks,
Jignesh
Blanket_1.png
Blanket_2.png

asgallant

unread,
May 31, 2012, 9:52:28 AM5/31/12
to google-visua...@googlegroups.com
It's not really a bug, exactly; the data point is there, it's just being rendered underneath the other point (and thus cannot capture the mouseover event that spans the tooltip).  You can set the 'focusTarget' option to 'category' to make the tooltips show all series values for a given axis value, though (which fixes the problem).
Reply all
Reply to author
Forward
0 new messages