Darrell Bulloch

Manually re-render chart in Angular

Recommended Posts

I am trying to cause the chart to re-render when new data is received.

1.  I gave the fusioncharts element in the template a id of "#fc".

      <fusioncharts
        [width]="width"
        [height]="height"
        [type]="type"
        [dataSource]="dataSource"
        #fc
      >

2. I used the @ViewChild() to obtain a reference to the element

  @ViewChild('fc', { static: false })
  fcany;

3. Then I called the render() method on the reference.

this.fc.render();

4. Although the compiler recognized that a render() method exists on the reference.

At runtime, a failure occurred stating that there is no render() method.

ERROR TypeError: this.fc.render is not a function

 

 

Share this post


Link to post
Share on other sites
On 1/3/2021 at 10:18 PM, Darrell Bulloch said:

I was using the wrong 'type' of chart for the data provided.

Feel free to revert back if you are still facing any problem

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now