question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to use legend_toggle

See original GitHub issue

Legend toggle gives me the following error when I toggle it.

g-charts-toggle

Example code in next.js

import { Chart } from 'react-google-charts'

export default () => (
  <Chart
    chartType="ScatterChart"
    data={[['Age', 'Weight'], [8, 12], [4, 5.5]]}
    options={{}}
    graph_id="ScatterChart1"
    width="100%"
    height="400px"
    legend_toggle
  />
)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
rakannimercommented, Jul 22, 2018

Hey !

Thanks for reporting the issue.

This should be fixed in latest version (>=2.0).

Feel free to re-open if it re-appears.

0reactions
maccybercommented, Jun 17, 2018

I changed this line

From:

let colors = [];

To:

let colors = this.props.options && this.props.options.colors ? this.props.options.colors : DEFAULT_CHART_COLORS;

That made it work as expected for me. Did not test it with custom colors though

Deployed to npm as @alheimsins/react-google-charts - repo maccyber/react-google-charts

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't choose legend on Switch : r/apexlegends - Reddit
Can't choose legend on Switch. It stays on the location loading screen throughout the character selection and I can't choose anyone but the ......
Read more >
TimeSeries: allow toggling of Legends like w/ Graph (old)
On the old Graph panel we used to be able to toggle panel legends on or off using the panel popup menu ("More..."...
Read more >
Legend issue - Group Layer Name and Headings toggl...
I'm unable to turn off group layer names and headings in my legend. ... Legend issue - Group Layer Name and Headings toggle...
Read more >
How can I use a legend in App Designer to toggle line visibility ...
In GUIDE or with 'figure', I can use the 'ItemHitFcn' callback of a 'legend' to toggle the visibility of a line on and...
Read more >
d3 error in legend toggling -- Uncaught DOMException
Error: "Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '#line_General Motors Truck Company (GMC)' is not a valid ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found