Comments (7)
@DalerAsrorov no problem, thanks for the quick response. Will take a look at this and submit a PR.
from britecharts-react.
Bump. Any workaround for this currently?
from britecharts-react.
@ronvenna thanks for bumping, we have not yet looked in this issue (due to different project priorities). I will look into it some time. Feel free to make a PR if you find a fix as well!
from britecharts-react.
Hi @ronvenna,
One workaround I've been able to use is to wrap the entire chart in a functional component. This way, it forces React to instantiate a new object every time it gets new props.
So instead of
render() {
const renderStackedArea = (props) => (
<ResponsiveStackedArea
data={stackedAreaData.with3Sources()}
{...props}
/>
);
return (
<Tooltip
data={stackedAreaData.with3Sources()}
render={renderStackedArea}
/>
);
}
you can do:
render() {
const renderStackedArea = (props) => (
<ResponsiveStackedArea
data={props.data}
{...props}
/>
);
const TooltipWithStackedArea = ({data}) => (
<Tooltip
data={data}
render={renderStackedArea}
/>
);
return (
<TooltipWithStackedArea
data={stackedAreaData.with3Sources()}
/>
);
}
This way, every time render()
gets called, it creates a new functional component which it then renders, creating a new instance of the chart with the new data and replacing the old.
In theory, this will result in worse performance. However, in my testing I haven't noticed it being any worse on the various devices I've tried.
from britecharts-react.
This is an issue that is affecting other charts as well, so I created a prototype comparing the Bar and Line charts where you can see the issue happening.
I can work on a solution for this and make a PR but I need some help finding the issue.
from britecharts-react.
This is already fixed too in the PR #164
from britecharts-react.
Thanks!
from britecharts-react.
Related Issues (20)
- Cant set tooltip title to empty string HOT 2
- Bar Chart Y-axis name value getting truncated to '...' HOT 14
- StackedArea chart doesn't render correctly HOT 2
- Support TypeScript HOT 16
- Add customMouseMove and customClick to Donut chart
- Importing withResponsiveness() helper HOT 7
- Update project's documentation HOT 5
- Update Node HOT 3
- Tooltip with StackedBar not being rendered HOT 10
- Parse error when when generating chart boilerplate via plop HOT 2
- Styling ticks to fix offset and overlap HOT 7
- highlightSliceById prop of Donut component is not working
- Chart does not render with Tooltip when data is progressively added HOT 4
- Feature Proposal HOT 7
- Support Locale in Bar Chart HOT 1
- Broken and unclear documentation HOT 10
- customClick method is not working HOT 3
- Move implementation into Hooks HOT 1
- Move into TypeScript HOT 1
- How to change the font-size for the x- and y-axes? HOT 3
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 britecharts-react.