Hello,

For testing purpose, Im creating a chart with views data.
With the table output display, I can see my dat correctly.

When I display the views page, I got nothing.

In the javascript console, Ive got the error message :

Uncaught Error: Row 0 has 2 columns, but must have 1

My view is only displaying one field, with no label, using the line chart.

I can't find any way to make it work ...

Comments

bobojo’s picture

I am experiencing the exact same issue. I found something that looked related to this issue in charts_google.inc in the _charts_google_populate_chart_data function. At the very end of the function, the following snippet seems to be part of the problem:

  // Stub out corner value.
  $data[0][0] = isset($data[0][0]) ? $data[0][0] : 'x';

  // Ensure consistent column count.
  $column_count = count($data[0]);
  foreach ($data as $row => $values) {
    for ($n = 0; $n < $column_count; $n++) {
      $data[$row][$n] = isset($data[$row][$n]) ? $data[$row][$n] : NULL;
    }
    ksort($data[$row]);
  }
  ksort($data);

It says it's trying to "Ensure consistent column layout," but it's only checking against the first row, which in my case just has one column based on that first line I pasted. All the other rows have two columns, however, so it's passing improper data to Google. (More info on this issue can be found on Stack Overflow.)

I tried forcing a second header column, like adding a 'y' column, but it just caused other errors. I'm not familiar with this code, so I'm not sure where this issue need to be fixed, but hopefully the data I've provided will give some additional help.

matysek145’s picture

I had the same problem and I solved it by adding label to the field that provides data for the chart.
As @boboji said, first row has only one column, but when you set label for that field, it will work.

katrien_w’s picture

I'm having the same problem, no chart is showing up (added as a panel). Setting a label doesn't help. I'll try with simple page display.

Pierre.Vriens’s picture

Seems to me that the answer from @asgallant in the link mentioned in #1 might help to actually solve this issue. Anybody any suggestions about if that's indeed a step in the direction for a fix to this issue?

Also, I think we should no longer consider a support request, but instead either a bug or a feature request. I'm not sure however if we should really consider this a bug, or rather a feature request. Feedback on that would be appreciated also.

fonant’s picture

Same problem here, adding a label for the data field solved it :)