Sign in to follow this  
bagus sutan

realtime chart

Recommended Posts

Guest Basundhara Ghosal

Hi Bagus,

Could you please refer to the Link below for the XML codes of the mentioned chart?

Ref.- http://www.fusioncharts.com/widgets/gallery/Data/RealTimeLine1.xml

Also, please refer to the "Charts" folder of the Download pack of the FusionWidgets_Trial for the SWF file for RealTimeLine charts.

Ref.- http://www.fusioncharts.com/Download.asp

 FusionWidgets_Trial>Charts>RealTimeLine.swf

Hope this helps. :)

Share this post


Link to post
Share on other sites
Guest Rajroop

Hey,

 

 

 

The list of the Real-time charts that FusionWidgets supports are:

 

 

 

Real-time Area

 

Real-time Column

 

Real-time Line

 

Real-time Stacked Area

 

Real-time Stacked Column

 

Real-time Line (Dual Y)

 

Real-time Angular

 

Real-time Bulb

 

Real-time Cylinder

 

Real-time Horizontal LED

 

Real-time Horizontal Linear

 

Real-time Thermometer

 

Real-time Vertical LED

 

 

 

Unfortunately, at the moment, neither the Funnel chart nor the Pyramid chart supports the real-time feature. I have made of your suggestion, though. :)

Share this post


Link to post
Share on other sites

Hi,

I'm developing realtime chart which data retrieved from archive database. The chart shows multiple data, but i'm stuck, can you help me how to retrieve the data and plot to chart.

here's the code:

<%@ Language=VBScript %>

<%

 dim exppoint, eq_sk

 

 exppoint=["PI103_KJI.PV","PI113_KJI.PV"] 

 eq_sk = split(exppoint, ",")

 'Connection String to PHD Data View

 set connT=server.CreateObject ("adodb.connection")

 connectT = "Provider=HwPHDProv.2;User ID=;Data Source=TENOPC41;Extended Properties=;Persist Security Info=False"

 on error resume next

 connT.Open connectT

 

 

 

for i=0 to 1 

Set oRsT=Server.CreateObject("adodb.recordset")

strSQLT = "SELECT * FROM IP_PHD_DATA WHERE TAGNAME = " & eq_sk(i) & "' AND SMPLINT()=1 AND TIMESTAMP>'NOW-10S'"

oRsT.Open strSQLT, connT

 

do while not oRsT.eof  

 x =oRsT("timestamp")

 y=oRsT("value")

 oRsT.movenext

loop

oRsT.close

next

 

 Response.Write("&label="& x & "&value=" & y & "|" & y)

 

%>

how can i show those to data?

thx. for ur help.

Regards,

Bagus Sutan

Share this post


Link to post
Share on other sites

Thx for the quick reply,

Since my company had bought the product, we have the doc, but i haven't got the change to look it over. can give me a brief explanation what to do with the code so i can show multiple dataset.

thx.

Bagus Sutan

Share this post


Link to post
Share on other sites

Hi, sorry to bother ... again

1. Where can I get the complete refrence for the properties each chart?

2. Can I put the value on the tap of Led Gauge?

thx for the quick reply.

Bagus Sutan

Share this post


Link to post
Share on other sites

Hi,

i want to pass some data to realtimedata.asp with some parameter as below:

<script type="text/javascript">

 var chart1 = new FusionCharts("../../script/FusionWidgets/RealTimeLine.swf?ChartNoDataText=Select Data", "ChId1", "1200", "400", "0", "1");

 chart1.setTransparent(true);

  chart1.setDataXML("<chart lineThickness='1' canvasBgAlpha='0'  bgColor='000000' bgAlpha='0' canvasBorderThickness='1' canvasBorderColor='76B900' canvasBgColor='000000' decimals='1' numdivlines='15' numVDivLines='150' numDisplaySets='150' divLineColor='008040' vDivLineColor='008040' divLineAlpha='100' chartLeftMargin='10' baseFontColor='00dd00' showRealTimeValue='0' labelDisplay='rotate' slantLabels='1' toolTipBgColor='000000' toolTipBorderColor='008040' baseFontSize='10' showAlternateHGridColor='0' legendBgAlpha='0'legendBgColor='000000'  legendPadding='35' showLabels='0' caption='SCADA Historical Trends'  legendBorderColor='57b746' legendAllowDrag='1' toolTipBorderColor='57b746' dataStreamURL='realtimedata.asp?tagname="<%=tagname%>"&tag=<%=tag%>' refreshInterval='1' updateInterval='5' drawAnchors='1' anchorRadius='1' numberPrefix='' setAdaptiveYMin='1' xAxisName='' showNames='0'  showRealTimeValue='0' realTimeValuePadding='50' labelDisplay='Rotate' slantLabels='1' ><categories ></categories><%response.write dataset%> <styles><definition><style type='font' name='captionFont' size='14' /></definition><application><apply toObject='Caption' styles='captionFont' /><apply toObject='Realtimevalue' styles='captionFont' /></application></styles></chart>");

  chart1.render("chart1div");

</script>

how can i do that?

Thanks,

Bagus Sutan

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Bagus,

Please try changing your code refering to the sample code that we are sending you :-

Ref :- <chart caption='Stock Price Monitor' subCaption='Google' dataStreamURL='" + escape('realtimedata.asp?tagname=<%=tagname%>&tag=<%=tag%>') + "' refreshInterval='2' numberPrefix='$' setAdaptiveYMin='1' xAxisName='Time' showRealTimeValue='1' realTimeValuePadding='50' labelDisplay='Rotate' slantLabels='1' ><categories></categories><dataset seriesName='Google' showValues='0'></dataset></chart>

(4:15 PM) Rahul Kumar: <chart caption='Stock Price Monitor' subCaption='Google' dataStreamURL='" + escape('realtimedata.asp?tagname=<%=tagname%>&tag=<%=tag%>') + "' refreshInterval='2' numberPrefix='$' setAdaptiveYMin='1' xAxisName='Time' showRealTimeValue='1' realTimeValuePadding='50' labelDisplay='Rotate' slantLabels='1' ><categories></categories><dataset seriesName='Google' showValues='0'></dataset></chart>

Hope this helps. :)

 

Share this post


Link to post
Share on other sites

Hi,

I've given it try, but it doesn't work.

The code you gave made xml like dataStreamURL='realtimedata.asp?tagname=PI105_KJI.PV,LI105_KJI.PV' but i need the value for the realtimedata.asp to catch value 'PI105_KJI.PV','LI105_KJI.PV'.

Need your help.

 

Regards,

 

Bagus Sutan

Share this post


Link to post
Share on other sites

Hi Bagus,

You would need to encode the URL like dataStreamURL='" + escape('realtimedata.asp?tagname=<%=tagname%>&tag=<%=tag%>')  or as the code posted before by Basundhara.

Also, to retrive the tagname & tag value in your realtimedata.asp page you can use simple Request object to get the value.

Example (in your realtimedata.asp):

dim tagname

dim tag

tagname=Request("tagname")

tag=Request("tag")

The above code is working fine in our labs.

Share this post


Link to post
Share on other sites

Thx here the code i wrote in realtimedata.asp:

 

 

 

set connT=server.CreateObject ("adodb.connection")

 

connectT = "Provider=HwPHDProv.2;User ID=;Data Source=TENOPC41;Extended Properties=;Persist Security Info=False"

 

on error resume next

 

connT.Open connectT

 

 

 

Set oRsT=Server.CreateObject("adodb.recordset")

 

strSQLT = "SELECT * FROM IP_PHD_DATA WHERE TAGNAME in ( "& tagname &") AND SMPLINT()=1 AND TIMESTAMP='NOW'"

 

oRsT.Open strSQLT, connT

 

 

 

do while not oRsT.eof

 

x =oRsT("timestamp")

 

valueGraph = valueGraph & "&value=" & oRsT("value")

 

RsT.movenext

 

loop

 

 

 

Response.Write("&label="& x & valueGraph )

 

 

 

strSQLT = "SELECT * FROM IP_PHD_DATA WHERE TAGNAME in ('PI133_KJI.V','LI133_KJI.PV' ) AND SMPLINT()=1 AND TIMESTAMP='NOW'" (for static code)

 

how can I check if the value is passed to realtimedata.asp

 

 

 

Need your guidance. Thx.

 

 

 

 

 

Regards,

 

 

 

 

 

Bagus Sutan

Share this post


Link to post
Share on other sites

Sorry for being impatient,

 

 

 

I tried one data and when i view source the xml came to like this:

 

dataStreamURL='" + escape('realtimedata.asp?tagname=PI112_KJC.PV') + "'

 

 

 

So I tried to make xml manually as I got from the source but the chart doesn't show any process just stop. What went wrong?

 

 

 

Regards,

 

 

 

 

 

Bagus Sutan

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Bagus,

We are glad to help you. :)

Could you please specify us the issue that you are still facing, a bit elaborately?

Awaiting your reply. :hehe:

Share this post


Link to post
Share on other sites

Thx for quick reply,

 

 

 

I'm facing problem for multiple data series which passed thru a parameter:

 

 

 

on realtimedata.asp I have code like this:

 

 

 

strSQLT = "SELECT * FROM IP_PHD_DATA WHERE TAGNAME in ('PI104_KJI.PV','LI104_KJI.PV') AND SMPLINT()=1 AND TIMESTAMP='NOW'" (for static code)

 

 

 

buat I tried to change with a parameter e.g tagname

 

 

 

strSQLT = "SELECT * FROM IP_PHD_DATA WHERE TAGNAME in ('"& tagname& "') AND SMPLINT()=1 AND TIMESTAMP='NOW'"

 

 

 

and It's passed thru from realdatachart.asp with the following code:

 

 

 

dataStreamURL='" + escape('realtimedata.asp?tagname=<%=tagname%>') + "' as your suggestion earlier but somehow It doesn't work, I can see the chart without realtime line showed.

 

 

 

Could give me some way out here?

 

 

 

Thx.

 

 

 

 

 

Bagus Sutan

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Bagus,

Thanks for your appreciation.

Could you please send the realtimedata.asp file with the complete code as an attachment so that we might look into the issue?

Awaiting your reply. :hehe:

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Bagus,

Thanks for sending us the complete code.

Could you please let us know whether tagname="'PI104_KJI.PV','LI104_KJI.PV'" is the exact value that you are passing in tagname?

Awaiting your reply.

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Bagus,

Also could you please send us an example of the process in which you are passing the value to the tagname variable?

Awaiting your reply. :hehe:

Share this post


Link to post
Share on other sites

this is the value submitted from main form to chart.asp:

 

 

 

tagname value PI116_KJI,FQI101A_KJI,FQI116C_KJI

 

 

 

 

 

and i want pass it to realtime data and convert to:

 

tagname value 'PI116_KJI','FQI101A_KJI','FQI116C_KJI'

 

 

 

so realtimedata.asp can do the job with the syntax:

 

strSQLT = "SELECT * FROM IP_PHD_DATA WHERE TAGNAME in ("& tagname &") AND SMPLINT()=1 AND TIMESTAMP='NOW'"

 

 

 

Thx for your help.

 

Awaiting your quick reply

 

 

 

 

 

Bagus Sutan

Share this post


Link to post
Share on other sites

Hi Bagus,

Thanks for the information.

You could do this in the following way (Please see the example):

1. Assign value to tagname variable as:

  tagname="PI116_KJI,FQI101A_KJI,FQI116C_KJI"

2. Pass it using this:

dataStreamURL='" + escape(realtimedata.asp?tagname=<%=tagname%>&tag=<%=tag%>') + "'

3. Now, in realtimedata.asp file use the following code:

 

' Getting the tagname value from Query string.

tagname=Request("tagname")

 

' Spilitting tagname with comma, we'll get an array.

arr1 = split(tagname,",")

' Loop variable

dim i

 

' Iterate to each array elements and add single quote (')  at both end

For i=0 to ubound(arr1)

 arr1(i)="'" & arr1(i) & "'"

Next

' Now we have an array appended with Single Quote.

' So, joining it now to get a complete string appended with Single Quote.

tagname=join(arr1,",") ' Result: 'PI116_KJI','FQI101A_KJI','FQI116C_KJI'

' Passing it to the query field.

strSQLT = "SELECT * FROM IP_PHD_DATA WHERE TAGNAME in ("& tagname &") AND SMPLINT()=1 AND TIMESTAMP='NOW'"

Hope this helps.

Edited by Guest

Share this post


Link to post
Share on other sites

Thx for the help,

 

 

 

I tried the method and the chart showed but there is no activity of the realtime data.

 

I can see only the canvas of the chart and legend of the data.

 

is there any way I can track the realtimedata.asp whether the value already sent or not.

 

 

 

 

 

Thx.

 

 

 

 

 

 

 

Bagus Sutan

Share this post


Link to post
Share on other sites

Thanks Guys, The code works just fine now. But still having problem with the performance.

 

When I click the button "btnShow" which located in iFrame name="iPFD" and attached function onclick="ShowGraph('KJI-R-PI-004 (1)'

 

 

 

function ShowGraph(equip) {parent.iTrend.document.location="RealTimeDataChartX.asp?equip="+equip+"&caption="+caption;}

 

 

 

it took minutes to show the chart. How can I tune up the performance. (btw, if i use window.open method it showed less then a minute)

 

 

 

 

 

Thx,

 

 

 

 

 

 

 

Bagus Sutan

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