Sign in to follow this  
tyler

Update RealTimeStackedColumn values instead of adding new ones

Recommended Posts

Hello,

 

I have a RealtimeStackedColumn chart, which I am just feeing random values to every second.  Every second when the chart updates, a new column is added (see picture).  What I would like instead is to have a fixed amount of columns (one for each day of the week) and then update the existing columns, depending on the data.

 

The code in my DataSource (I am using C#) is:

Response.Write ("&label=" + label+ "&value=" + randomValueCr1 + "|" 
+randomValueCr4 + "|" + randomValueCr5);

nJgBO.png

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

Welcome to FusionCharts Forum.

 

Using "RealTimeStackedColumn" of FusionWidgets XT Pack, you can achieve your requirement by setting "numDisplaySets" attribute to "7" and pushing multiple updates (7 data points in your case) on each update request.

 

Please note that in this case, at a time 7 data points need to be send on every data update request.

 

Please find the attached sample implementation of the same for your reference.

 

Also, for more information on "Adding multiple datasets", please visit the link: http://docs.fusioncharts.com/widgets/Contents/?DataStreaming/MultipleDatasets.html

 

However, as an alternative I can suggest you to use normal "StackedColumn2D" chart of FusionCharts XT Package and change the data depending on the response of the back-end and set the updated data back to the chart using setChartData().

 

For more information on "Providing and updating chart data", please visit the link: http://docs.fusioncharts.com/charts/contents/JavaScript/JS_ChangeData.html

 

Hope this helps!

 

Real-TimeStackedColumnChart.zip

Share this post


Link to post
Share on other sites

Sorry, what exactly is the format for multiple updates?

 

I tried:

&label=Mon&value=78|33|74&label=Tue&value=17|63|47&label=Wed&value=24|40|58&label=Thu&value=88|40|63&label=Fri&value=18|19|78&label=Sat&value=94|87|89&label=Sun&value=94|90|63

but they still render one at a time.

 

 

EDIT:

 

Also tried:

&label=Mon,Tue,Wed,Thu,Fri,Sat,Sun&value=17|35|34,14|52|48,43|91|58,90|14|50,13|93|43,2|47|22,92|43|82

which gives me the 7 days each time, but only Monday has data on the chart.

Edited by tyler

Share this post


Link to post
Share on other sites

I should've looked at your example earlier...

For anyone else that finds this and get stuck, the format is:

&label=Mon,Tue,Wed,Thu,Fri,Sat,Sun&value=26,85,23,69,97,28,61|81,45,25,30,14,85,92|29,35,53,79,55,66,30

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
Sign in to follow this