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.

Synced Charts are getting too many Options overwritten.

See original GitHub issue

I have multiple <ApexChart>'s that share a group in order to synchronize the tooltips.

image

When I hover over “MAX(value)”, they’ll all get the same title

image

I tracked it down to multiple issues.

1. Something in apexcharts.js is modifying ApexCharts.props.options directly.

On the 2nd render of ApexCharts, this.chart.updateOptions(this.getConfig()) is being called because the prevOptions !== currentOptions https://github.com/apexcharts/react-apexcharts/blob/7345fdca622358f181aa64e1cdfc76f592f4bdf0/src/react-apexcharts.jsx#L116

When I pause the debugger, something has added xaxis.convertedCatToNumeric: false to my props.options

To get around this you should probably: A. Do a deep clone of options in getConfig(). B. Deep clone options in apexcharts.js. C. Stop modifying options in apexcharts.js

2. _updateOptions in apexcharts.js shouldn’t update so many options for Synced Charts

https://github.com/apexcharts/apexcharts.js/blob/433fccce57a1dfd3ff1b67a731818189146ca7ca/src/modules/helpers/UpdateHelpers.js#L63

What’s happening in my example, is you’re taking the options for the bottom chart and applying it to all the charts (minus the series).

I’m not sure the reasoning for doing this, but options like title.text definitely should not be synced, and I imagine many others.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

1reaction
joshribakoffcommented, Apr 27, 2022

Also confirming that simply deep cloning in getConfig() solves the problem as @cdeutsch suggests. This should be an easy PR

0reactions
Andynopolcommented, Dec 15, 2022

Easy PR and 3 years late, the problem is still here. At this point, I think I am diching apexchart…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Instant synchronization of chart drawings - YouTube
Instant synchronization means all of your chart layouts, on all devices, tabs or windows, will now sync with each other.If you have a...
Read more >
Sync drawings in the multiple chart layout - YouTube
Welcome back to another TradingView tutorial! Today, you will learn how to sync drawings across the multiple chart layout.
Read more >
Allow overwrite option to be modified for pull mirroring without ...
Summary. When force-pushing to a remote branch (in this case the master branch) on a repository that is mirrored by GitLab (pull mirror)...
Read more >
Avoid getting throttled or blocked in SharePoint Online
For requests that an application makes, including Microsoft Graph, CSOM or REST calls, SharePoint Online returns HTTP status code 429 ("Too many ......
Read more >
Bar chart options | Looker - Google Cloud
Bar charts are useful for showing comparisons between categories of data, or for comparing changes for multiple groups over the same time period....
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