Comments (8)
Hi @tjugg
All should boli down to a chart being created (init options) and then updated (possibly multiple times), so please share the (minimal if possible) code used to create and update the problematic chart. You could use exemplary data as long as it recreate the problem.
from highcharts-react.
Alright, so here is an example using the ref route.
This is in the render() function
<HighchartsReact highcharts={HighchartsStock} constructorType={'stockChart'} options={chartOptions} ref={'chart'} />
Here is the initial options + adding dynamically via refs:
`const chart = this.refs.chart;
if (chart !== undefined) {
chart.chart.addSeries({
name: 'OK',
data: [1, 2, 3]
});
chart.chart.redraw();
}
if (chart === undefined) {
return {
title: {
text: 'Crash'
},
yAxis: {
title: {
text: 'Title'
}
}
}
}`
Sorry for the bad formatting. So the initial chart options is what is returned in the last code snippet. That crashes for me. BUT if I remove the yAxis configuration, that chart updates just fine without crashing. The other way I tried it, was to just return a new set of options on every update to the component. This ends with the same result. Both options work fine via HighChart, not HighStock.
from highcharts-react.
https://pastebin.com/iiGjfneq this is pretty much the code.
from highcharts-react.
@KacperMadej even https://github.com/highcharts/highcharts-react/blob/master/demo/demo.jsx crashes when you try to force update the component.
from highcharts-react.
@tjugg and @KacperMadej
I also have issues with the stockChart
as well as the regular chart
when there is navigator.enabled = true
Do either of you think this might essentially be the same issue as this one in the highcharts repo about highstock navigator?
I submitted a PR (#45) for addressing the oneToOne
prop-passing, but it doesn't resolve the highstock issue except for initial loading—updating series still doesn't work, I believe because of a bug at the highstock level
from highcharts-react.
@scottclayton I am not sure if it's the same issue, but this is definitely a bug. @KacperMadej ?
from highcharts-react.
tl;dr This is the same problem as the one reported in Highcharts: highcharts/highcharts#8196 + bad demo in this repository.
Long / full story:
It was not possible to set oneToOne
to false
due to a bug in code that was fixed thank to @scottclayton - thank you very much for finding the source of the problem and submitting the PR. New version of the wrapper (1.3.2) is updating to NPM's highcharts-react-official
as I'm typing this.
In the demo simplified structure looks like main component with 4 chart components. On first chart options update done through the main's container setState
update check runs through it's child components and because update
prop is by default set to true, then shouldComponentUpdate
by default returns true
. This causes update on other charts - stock and map charts included and because oneToOne
for the stock chart is set to true
the update causes the error reported in main Highcharts repository.
We are working or rewriting this wrapper to work better with new versions of React, so drastic changes are not planned until version 2 of this wrapper will be released. For now only emergency fixes are committed, so the demo is still showing the problem, but thank to the PR by @scottclayton it's avoidable by code changes.
There's no ETA for v2.0.0 for now, but it should be done within next few weeks.
@tjugg Please check with new code and oneToOne
set to false
for stock charts and if this doesn't help please provide more details about how the problem could be recreated - app that could be build, like this repository and it's demo, would be helpful for debugging of your problem.
from highcharts-react.
Closing due to inactivity.
from highcharts-react.
Related Issues (20)
- Usage in React, Grid lines not visible HOT 2
- Tooltip is going under axis-component HOT 8
- Chart values and options doesn't trigger re-render HOT 2
- Zones rendering issue after updating to [email protected] HOT 5
- Issue whille integrating packedbubble in react-highcharts HOT 15
- TypeError: Cannot read properties of undefined (reading 'length') HOT 1
- Plotbands added via API are not added to plotOptions HOT 2
- Next.js 14.1.0 Cannot read properties of undefined (reading 'document') HOT 2
- Add a react ref to each point HOT 4
- chart.update() refression with yAxis behavior HOT 23
- Unexpected series order when adding linkedTo series HOT 2
- Cannot read properties of undefined (reading 'forEach') HOT 4
- Server side rendering of React components HOT 2
- Issue with borderRadius object HOT 1
- i am unable to draw a Polar (Radar) chart HOT 2
- Is this the correct way to use the Boost module to improve performance? HOT 3
- Updating a column chart's series data with dataSorting: enabled causes a crash HOT 2
- Bar Chart Rendering is different if I use boost HOT 3
- Leaving the page with a highstock chart in it throws multiple console errors despite chart doing its job HOT 4
- Issue: Component Getting Unmounted from DOM When Using Scroll HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from highcharts-react.