Giter VIP home page Giter VIP logo

Comments (5)

Pauan avatar Pauan commented on July 17, 2024

@pranav-xx Could you please provide your code?

from amcharts3-react.

yairEO avatar yairEO commented on July 17, 2024

for me, when I call the validateNow method on my amChart (after it was rendered on the screen and nothing else was happening) the whole chart disappears!

from amcharts3-react.

Pauan avatar Pauan commented on July 17, 2024

@yairEO You shouldn't call validateNow or validateData

Instead, you should:

  1. Create some state for your component.

  2. Use the state in the render method.

  3. Use setState to change the state.

This is the normal way to change state in React.

from amcharts3-react.

nk2580 avatar nk2580 commented on July 17, 2024

this does not rigger a change in the chart for me though, even though my data is there.. why is that?

from amcharts3-react.

raymondsiu avatar raymondsiu commented on July 17, 2024

@nk2580 I had this issue before when my render method made reference to a config like:

class Chart extends React.Component {
  render() {
    const { styles, config } = this.props;
    return (
      <div style={ styles }>
        <AmCharts.React options={config} />
      </div>
    );
  }
}

When I made updates to the config prop it wasn't causing re-renders because passing the config to the component was passing by reference.
To force the re-render and essentially update the chart, everytime I updated the config prop from the parent component, I would use _.cloneDeep(config) to ensure a new reference is generated.

Hope that sort of helps.

from amcharts3-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.