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.

Using custom legend to toggleSeries in a React app

See original GitHub issue

Using the import Chart from ‘react-apexcharts’; method to generate a Chart <Chart options={this.state.options} series={this.state.series} type="line" />

There doesn’t seem to be away to use ApexCharts.toggleSeries to toggle a series line with react-apexcharts

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

25reactions
Amber-Williamscommented, Jul 4, 2019

Figured out the solution and thought I would post it here for anyone else

import Chart  from 'react-apexcharts';
import ApexCharts from 'apexcharts';
toggle (e) {
  ApexCharts.exec('graphID', 'toggleSeries', e.target.value);
}

render() {
  <>
    <button value="seriesNameHere1" onClick={this.toggle}>Series 1</button>
    <button value="seriesNameHere2" onClick={this.toggle}>Series 2</button>
    <Chart
      options={this.state.options}
      series={this.state.series}
      type="line"
    />
  </>
}
0reactions
KostiantynFilipenkovcommented, Jul 22, 2022

@Amber-Williams Thanks for help, Have example for hover Item ?

Hello! Did you find a solution? How to call hover?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom legend - ApexCharts - CodePen
Insecure Resource. The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https....
Read more >
legend - ApexCharts.js
customLegendItems : Array. Allows you to overwrite the default legend items with this customized set of labels. Please note that the click/hover events...
Read more >
Toggle all data series upon clicking a legend in Apex charts
The toggle series function will hide or display all legends depending upon the current state of the chart. function toggleSeries( id: string | ......
Read more >
react-apexcharts examples - CodeSandbox
Learn how to use react-apexcharts by viewing and forking react-apexcharts example apps on CodeSandbox.
Read more >
Toggle all data series upon clicking a legend in Apex charts ...
[Solved]-Toggle all data series upon clicking a legend in Apex charts-Reactjs ... using state value in state data for apex charts within react...
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