-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: cannot provide rows/columns separately to GeoChart #583
Comments
I have the same issue after updating to v4.0.0 for other chart types with the error message "Table has no columns" (for example for the scatter plot in the "Initialize using rows and columns" example in the walkthrough). As you say, providing data={[columns, ...rows]} works, but initializing columns and rows separately causes an error. |
Ran into the same issue, appreciate the workaround though |
The problem is in the condition of the GoogleChartDataTable:
If I set only columns and rows to the Chart component, then the variable data is undefined. Rendering the graph goes through the first condition (i.e. data ! = null), rows and columns are not set. Another workaround is to set the data to null:
|
…undefined Related to rakannimer#583
Would you like to work on a fix?
Current and expected behavior
Consider the following data:
The following chart configuration results in "Incompatible data table: Error: Unknown address type." error:
Providing
data={[columns, ...rows]}
instead of the separaterows
andcolumns
properties works as expected.Note that this worked fine in pre-v4, so it was likely broken recently.
Reproduction
https://codesandbox.io/s/funny-tharp-6ymtob
react-google-charts version
v4
Possible solution
I suspect that the propagation of
rows
andcolumns
down toGoogleChartDataTable
is broken somewhere, so instead of the appropriate treatment the flow goes to the default option (which apparently creates invalid results for GeoChart). Yet, I wasn't able to trace through the code where it happens.The text was updated successfully, but these errors were encountered: