Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
bobojo CreditAttribution: bobojo commentedI 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: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.
Comment #2
matysek145 CreditAttribution: matysek145 commentedI 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.
Comment #3
katrien_w CreditAttribution: katrien_w commentedI'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.
Comment #4
Pierre.Vriens CreditAttribution: Pierre.Vriens commentedSeems 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.
Comment #5
fonant CreditAttribution: fonant commentedSame problem here, adding a label for the data field solved it :)