Giter VIP home page Giter VIP logo

Comments (3)

KamilKubik avatar KamilKubik commented on September 25, 2024

Hello rolandvincze,

Thanks for contacting us and bringing up this problem!

By default, Highcharts creates a reference to the provided data, not a direct copy, so data points seem overridden during the rerenders after the initial one. Nevertheless, I wouldn't classify it as a bug since by definition id should be a unique value that Highcharts handles as expected. I'd also expect a warning message in the console indicating that using the repeated IDs may lead to some unexpected behaviors. Since the change should be made to the Highcharts core code, feel free to report it here.

What you can do is change the Highcharts's initial data mutation by using the chart.allowMutatingData property set to false to create a direct copy of the provided data. Please refer to your updated example and the API reference.

Kind Regards!

from highcharts-react.

rolandvincze avatar rolandvincze commented on September 25, 2024

Hi @KamilKubik,

Thank you for the answer! I would have another question regarding this, does this change come with any other side effect besides possible performance issues? (I'm interested in side-effects functionality-wise mainly).

Kind Regards!

from highcharts-react.

KamilKubik avatar KamilKubik commented on September 25, 2024

From the Highcharts perspective, the mentioned copy is created based on your initial data only. Since this functionality refers to the data directly, I assume the only side effects you can potentially face are related to updating the data. Nevertheless, you shouldn't encounter any apart from the possible performance issues. What I'd potentially expect is the rerendering issues related to React. But I'd be concerned about this only when you face it (your case is a bit specific, and I haven't found any related threads) - feel free to share your code in that scenario.

Regards!

from highcharts-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.