juaninacio Report post Posted July 21, 2009 I have tried pre-populating real time charts so they do not start blank but with historical data I have stored in my db. I still couldn't figure how to achieve such thing really and I would appreciate some help on this. I thought that one option: var so = new SWFObject("../charts/Charts/FI2_RT_Line.swf", "FusionCharts", "640", "480", "7", "#FFFFFF"); so.addVariable("chartWidth", "640"); so.addVariable("chartHeight", "480"); so.addVariable("debugMode", "1"); so.addVariable("dataURL", "../ajax/chart_config.php%3Fds%3D61,cpu_idle,cpu_iowait,cpu_irq,cpu_nice,cpu_softirq,cpu_system,cpu_user%26width%3D640%26height%3D480%26points%3D30%26refresh%3D60%26multiplier%3D%26title%3DCpu%26subtitle%3D%26decimal%3D%26numberprefix%3D%26numbersuffix%3D%26yaxis%3D%26xaxis%3D"); if calling that dataURL I get the following code which works ok: <dataset color='FFF690' seriesName='Idle' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> <dataset color='EFAB40' seriesName='IO wait' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> <dataset color='FF4040' seriesName='CPU IRQ' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> <dataset color='B2B2D8' seriesName='Nice' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> <dataset color='408CB2' seriesName='Soft IRQ' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> <dataset color='8CB266' seriesName='System' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> <dataset color='40A8DA' seriesName='User' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> <chart caption='Cpu' subCaption='' bgColor='FFFFFF' canvasBorderThickness='1' canvasBorderColor='000000' canvasBgColor='ffffff' baseFont='arial' shownames='1' rotateNames='1' showLimits='1' chartLeftMargin='30' yAxisMaxValue='0' hovercapbg='FFECAA' hovercapborder='F47E00' formatNumber='1' formatNumberScale='1' decimalPrecision='0' divLineDecimalPrecision='0' divLineColor='FFFFFF' numdivlines='6' alternateHGridColor='CCCCCC' showAlternateHGridColor='1' divLineThickness='0' divLineAlpha='100' vDivLineColor='CCCCCC' numVDivLines='8' alternateVGridColor='CCCCCC' showAlternateVGridColor='0' VDivLineThickness='1' showAreaBorder='0' numDisplaySets='30' baseFontColor='000000' baseFontSize='10' showRealTimeValue='0' dataStreamURL='../ajax/get_data.php?render=fusion%26latest=1%26ds=61%2Ccpu_idle%2Ccpu_iowait%2Ccpu_irq%2Ccpu_nice%2Ccpu_softirq%2Ccpu_system%2Ccpu_user%26multiplier=1%26refresh=60' refreshInterval='60' numberSuffix='' numberPrefix='' hoverCapBgColor='FFffff' hoverCapBorderColor='000000' > <categories> <category name='14:02' /> </categories> <dataset color='FFF690' seriesName='Idle' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> <dataset color='EFAB40' seriesName='IO wait' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> <dataset color='FF4040' seriesName='CPU IRQ' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> <dataset color='B2B2D8' seriesName='Nice' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> <dataset color='408CB2' seriesName='Soft IRQ' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> <dataset color='8CB266' seriesName='System' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> <dataset color='40A8DA' seriesName='User' showValues='0' alpha='100' anchorAlpha='0' lineThickness='2'><set value='0' /> </dataset> </chart> then that dataStreamURL returns values like this, also works fine: &value=2|3|2|10|&name=13:36 I tried adding some data to the dataset area to have the chart pre-populated when loading but that wouldn't work, it doesn't matter what I add the chart looks always empty when loading it. I thought I could just find a way of quickly quering for the first 30 points so they load historical data (every 0.1 so it does it quickly) and then slow down the update rate and start returning current values. There are ways to do that, but What I am not able to do is to slow down the refresh period once it has been set. Can anybody help with this? Ideas / suggestions, all will be very appreciated. Regards, Juan Share this post Link to post Share on other sites
Guest Rajroop Report post Posted July 21, 2009 Hello , Welcome to the FusionCharts Forum. :w00t: Could you please refer to the following link for information on how to add historical data? (Ref: http://www.fusioncharts.com/widgets/docs/Contents/DSC_Historical.html) Unfortunately, you can not re-set the refresh interval after it has been set once in the <chart> element. For any further information regarding Data Streaming charts, please refer to the FusionWidgets Documentation and click on the Data Streaming Charts section, on the left hand menu panel. I hope this information proves to be useful. Share this post Link to post Share on other sites