Ravikumar Sutagundi

Changing chart type dynamically

Recommended Posts

Hi,

I am facing the issue with the below scenario.
I have 2 charts rendered in a page. Changing 2nd  chart type, is changing the first chart type. Attached are the screenshots for your reference.

After investigation found out that, the chart is getting appended to a div with id "container-"  just beneath <fusioncharts> tag.

Any help is highly appreciated.

image.thumb.png.230833b1566f4789ddfa96e946b283ba.png

 

image.thumb.png.7e37099e952df2f4985fee74ca3e0b41.png

image.thumb.png.405b451dfa6460045384b8f8d386b6cf.png

Regards,

Ravi

 

Share this post


Link to post
Share on other sites

Hi,

Please check the implementation once, it seems like you are updating the chart type for the first chart, also please check whether you are using FusionCharts chartType API method to change its chart type at the runtime, to know more check this link -  https://www.fusioncharts.com/dev/api/fusioncharts/fusioncharts-methods#charttype-6

If you are still facing any problem kindly share us a sample replicating the problem or live URL so that we can investigate it further. 

Share this post


Link to post
Share on other sites

Hi,

Thanks for your reply.  I am using angular2 fusion charts.

I am updating the chart type for the second chart. The dom shows the proper data. But the div with id "container-" will get replaced with the latest data. I mean the second chart data get's replaced with the first one. And the div with id "container-" will be empty for the second chart.

I have no live application to share the URL, since still in development. I can share the DOM screen shot, if needed.

Edited by Ravikumar S

Share this post


Link to post
Share on other sites

Hello,

Thanks for the reply. Sincere apologies, as I cannot provide you a sample. Please find the attached screen shots of DOM showing what happens when I change the chart type of second one.

Possibly could give some hint. If you please look into the first image,  div with id="container-" just beneath fusioncharts tag has a span with id="chartobject-6" for first chart and id="chartobject7" for second chart respectively. When I change chart type for second chart, the span with id="chartobject-6" gets replaced with "chartobject-7" which is content of second chart and second chart's span will just disappear.

image.thumb.png.c935c07cf1bcf72eac0ba440d4629441.png

 

image.thumb.png.00b3316f74acc86680a0e9cedfc124a9.png

Edited by Ravikumar S

Share this post


Link to post
Share on other sites

Hi,

Thanks for noting the issue. These chart container id's will be generated dynamically by fusioncharts. We don't do anything for these. I am trying to find through source code, however not able to find out the code. Found for span within div, but not for the div itself.

 

Regards,

Ravi

Share this post


Link to post
Share on other sites

Hello Ayan,

With regards to the same drill down, have one more issue. When I change chart type from AngularGauge to HLinearGauge and vice versa gets this error.

core.es5.js:1020 ERROR TypeError: Cannot read property ' rearextension ' of undefined

Please find the below stack trace for your persual.

core.es5.js:1020 ERROR TypeError: Cannot read property 'rearextension' of undefined
    at a._spaceManager (fusioncharts.widgets.js:456)
    at a._manageSpace (fusioncharts.js:1033)
    at a.draw (fusioncharts.js:1041)
    at Object.k [as job] (fusioncharts.js:1001)
    at q (fusioncharts.js:39)
    at ZoneDelegate.invokeTask (zone.js:367)
    at Object.onInvokeTask (core.es5.js:3881)
    at ZoneDelegate.invokeTask (zone.js:366)
    at Zone.runTask (zone.js:166)
    at ZoneTask.invoke (zone.js:420)
    at data.args.(anonymous function) (webpack-internal:///./node_modules/zone.js/dist/zone.js:1581:29)

Share this post


Link to post
Share on other sites
On 7/18/2018 at 12:56 PM, Ayan Bhadury said:

Hi, 

We are working on this we would get back to you with the updates accordingly.

Appreciate your patience.

Hello Ayan,

May I know whether this has been fixed in latest version or not?

Appreciate your response.

Regards,

ravi

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