Sign in to follow this  
RubendeVroome

Update Chart Data With Datastreamurl

Recommended Posts

Hello,

 

I've downloaded the demo project from fusioncharts.com, because I needed the cylinder gauge.

So, I've removed everything but the code for the cylinder gauge.

I still use the DataGen.aspx.cs the Default.aspx.cs the default.aspx and offcourse the javascript functions.

I have cleaned them all op allthough.

I retreive data from a MySql database and load it into the cylinder gauge via a XML file.

This all works perfectly!

But the database is updated every minute, so I want the cylinder to look for new data.

I saw that this is made possible by adding a dataStreamURL and a refreshInterval to the XML code for the cylinder gauge.

I have tried several URL and methods but non of them works.

Can anyone tell me the right URL to update the data to de cylinder gauge ??

I refresh every 3 seconds, so this can not be an issue.

 

Thanks allready!!

 

Ruben

Edited by RubendeVroome

Share this post


Link to post
Share on other sites
Guest Sumedh

Hello,

 

I've downloaded the demo project from fusioncharts.com, because I needed the cylinder gauge.

So, I've removed everything but the code for the cylinder gauge.

I still use the DataGen.aspx.cs the Default.aspx.cs the default.aspx and offcourse the javascript functions.

I have cleaned them all op allthough.

I retreive data from a MySql database and load it into the cylinder gauge via a XML file.

This all works perfectly!

But the database is updated every minute, so I want the cylinder to look for new data.

I saw that this is made possible by adding a dataStreamURL and a refreshInterval to the XML code for the cylinder gauge.

I have tried several URL and methods but non of them works.

Can anyone tell me the right URL to update the data to de cylinder gauge ??

I refresh every 3 seconds, so this can not be an issue.

 

Thanks allready!!

 

Ruben

 

 

Hi,

 

For real-time update, you would need to add dataStreamURL and refereshInterval attributes in the chart XML/JSON.

 

dataStreamURL attribute sets the path of the page which is supposed to relay real-time data to the chart.

 

refreshInterval - for this attribute, you can specify the number of seconds after which the chart will look for new data. This process will happen continuously - i.e., if you specify 5 seconds here, the chart will look for new data every 5 seconds.

 

For more information, read here: http://docs.fusionch...r/RealTime.html

 

Also, you would need to modify the data provider page according to your SQL-query (data you want to retrieve and update).

 

Find attached illustration for your reference.

RealTimeCylinder.zip

Share this post


Link to post
Share on other sites

Hi,

 

For real-time update, you would need to add dataStreamURL and refereshInterval attributes in the chart XML/JSON.

 

dataStreamURL attribute sets the path of the page which is supposed to relay real-time data to the chart.

 

refreshInterval - for this attribute, you can specify the number of seconds after which the chart will look for new data. This process will happen continuously - i.e., if you specify 5 seconds here, the chart will look for new data every 5 seconds.

 

For more information, read here: http://docs.fusionch...r/RealTime.html

 

Also, you would need to modify the data provider page according to your SQL-query (data you want to retrieve and update).

 

Find attached illustration for your reference.

 

I think I still do something wrong.

I have put your project in the wwwroot foler of my server.

but it still doesn't update.

It runs fine, but stays at 50.

it doesn't adjust the value given in the xml file

any ideas?

 

 

it also gives an error in the web.config file.

targetFramework is unknown.

the command ofcourse, not the framework itself.

Edited by RubendeVroome

Share this post


Link to post
Share on other sites
Guest Sumedh

I think I still do something wrong.

I have put your project in the wwwroot foler of my server.

but it still doesn't update.

It runs fine, but stays at 50.

it doesn't adjust the value given in the xml file

any ideas?

 

 

it also gives an error in the web.config file.

targetFramework is unknown.

the command ofcourse, not the framework itself.

 

Hi,

 

You would need to set proper path for the data provider page in the dataStreamURL attribute.

 

Please check if the path is properly configured or not.

Share this post


Link to post
Share on other sites

Hi,

 

What error message did you get?

 

Can you provide error details of the same?

 

The error was that it couldn't find the reference for system.linq.

one last questions.

how do I add one cylinder?

esspecially in the html file and the default.apsx.cs

how does an object refer from default.aspx.cs to cpudata.aspx.cs?

Share this post


Link to post
Share on other sites

The error was that it couldn't find the reference for system.linq.

one last questions.

how do I add one cylinder?

esspecially in the html file and the default.apsx.cs

how does an object refer from default.aspx.cs to cpudata.aspx.cs?

 

 

I already have this:

 

string name = RenderChart.chartId;

int rank;

switch (name)

{

case "tank1":

rank = 1;

break;

case "tank2":

rank = 2;

break;

}

 

int value = 1;

 

string strSQL = "select waarde from rank" + rank + " where time = (select max(time) from rank" + rank + ");";

 

This doesn't work.

how can I get the chartId from the Chart that is currently handled.

this way I can get different data out of the database for the two charts.

Share this post


Link to post
Share on other sites

I render the Charts in the file default.aspx.cs like this:

 

tank1.Text = FusionCharts.RenderChart("Script/Cylinder.swf","data.xml","","mychart1","250", "400", false, true);

tank2.Text = FusionCharts.RenderChart("Script/Cylinder.swf","data2.xml", "", "mychart2", "250", "400", false, true);

 

I suppose that each of this charts one by one gets updated by CPUData.aspx.cs

what I want, is to update these charts with two different sql statements.

So in the CPUData.aspx.cs I want to know which chart is currently handled.

I want to do this in the following kind of way:

 

string name = Convert.ToString(RenderChart.chartId);

int rank;

switch (name)

{

case "mychart1Div":

// set sql statement for chart 1

break;

case "mychart2Div":

// set sql statement for chart 2

break;

}

 

my problem is in the first line: string name = Convert.ToString(RenderChart.chartId);

the command RenderChart.chartId is not right.

my question is what the right command for this action is.

 

Thank you!

Share this post


Link to post
Share on other sites
Guest Sumedh

I render the Charts in the file default.aspx.cs like this:

 

tank1.Text = FusionCharts.RenderChart("Script/Cylinder.swf","data.xml","","mychart1","250", "400", false, true);

tank2.Text = FusionCharts.RenderChart("Script/Cylinder.swf","data2.xml", "", "mychart2", "250", "400", false, true);

 

I suppose that each of this charts one by one gets updated by CPUData.aspx.cs

what I want, is to update these charts with two different sql statements.

So in the CPUData.aspx.cs I want to know which chart is currently handled.

I want to do this in the following kind of way:

 

string name = Convert.ToString(RenderChart.chartId);

int rank;

switch (name)

{

case "mychart1Div":

// set sql statement for chart 1

break;

case "mychart2Div":

// set sql statement for chart 2

break;

}

 

my problem is in the first line: string name = Convert.ToString(RenderChart.chartId);

the command RenderChart.chartId is not right.

my question is what the right command for this action is.

 

Thank you!

 

Hi,

 

You would need to use two data provider pages to implement two different SQL queries on single chart.

 

Could you please explain why you want to use this mechanism?

 

What are you trying to achieve exactly?

Share this post


Link to post
Share on other sites

Hi,

 

You would need to use two data provider pages to implement two different SQL queries on single chart.

 

Could you please explain why you want to use this mechanism?

 

What are you trying to achieve exactly?

 

We have got a number of tanks and I want to display the amount of kg in each tank.

for one tank I succeeded, but I actually don't know how to add another tank.

Maybe I will also add a Line or Area chart for the use of the liquid in a specefic time.

so my question is actually, how do I add another chart and retreive data for each chart?

I have added my prject, so you can take a look at what I allready have.

 

 

 

What kind of project did you use?

I can't open it in visual studio, so I can only adjust the the cs files.

If you can tell me what kind of project is was, I can dowload the correct format

Project.zip

Edited by RubendeVroome

Share this post


Link to post
Share on other sites

We have got a number of tanks and I want to display the amount of kg in each tank.

for one tank I succeeded, but I actually don't know how to add another tank.

Maybe I will also add a Line or Area chart for the use of the liquid in a specefic time.

so my question is actually, how do I add another chart and retreive data for each chart?

I have added my prject, so you can take a look at what I allready have.

 

 

 

What kind of project did you use?

I can't open it in visual studio, so I can only adjust the the cs files.

If you can tell me what kind of project is was, I can dowload the correct format

 

I am able to open it now, stupid mistake of mine.

 

but my question remains.

how can I ad one cylinder or other chart?

 

I also would like to change the color of liquid in the cylinder if it goes under a certain value, say 10000 kg.

the i do this right now, is to re-write te whole xml file.

but this way i have to refresh the page, for the cylinder to change color.

any solution on how to do this in kind of the same way as the change of the kg value?

so that i don't have to refresh the whole page?

Edited by RubendeVroome

Share this post


Link to post
Share on other sites

I would like to change the color of liquid in the cylinder if it goes under a certain value, say 10000 kg.

the way I do this right now, is to re-write te whole xml file.

but this way i have to refresh the page, for the cylinder to change color.

any solution on how to do this in kind of the same way as the change of the kg value?

so that i don't have to refresh the whole page?

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

Changing color of the liquid after reaching a certain level without refreshing the page is not possible.

 

Thanks for your time.

Share this post


Link to post
Share on other sites

Hi,

 

Changing color of the liquid after reaching a certain level without refreshing the page is not possible.

 

Thanks for your time.

 

Okee, that was it for now.

 

Thank you very much for all your time!!

You helped me a lot!

Share this post


Link to post
Share on other sites
Guest Sumedh

Okee, that was it for now.

 

Thank you very much for all your time!!

You helped me a lot!

 

 

smile.gif

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