mpaul Report post Posted December 28, 2012 We are testing the fusion charts trial version for our sysadmin graphs . Facing issues with displaying all the data points for all the items . Background: We have captured the nmon output into mysql tables and my query shows all the data points for each control break. Issue : When I render using ScrollStackedColumn2D.swf it only displays a part of the data. Is this because this is the Trial Version .. how to test /view the data showing up all across the time line.. here// I need to test out all the aspects before we can proceed to purchase .. Snip : please note the rsync values : which shows perfectly on the left sides here. ( chart_left.jpg ) but vanishes when I scroll to the right ..(chart_right.jpg ) The mysql data from query looks like : query : select Command as Process, ZZZZ as TimeStamp , CPU_PCT FROM nmon.top where ZZZZ = FROM_UNIXTIME(UNIX_TIMESTAMP(ZZZZ)- UNIX_TIMESTAMP(ZZZZ)%(30*60)) and hostname = 'wkr-sybase01' and ZZZZ >= DATE_SUB(current_date(),INTERVAL 3 DAY) and Command not like '%wq%'[attachment=5778:chart_left.JPG] and CPU_PCT > 5 group by Command ,ZZZZ order by Command ; output : data jpg php code : // SQL query for category labels unset ( $top_strQueryCategories ,$top_resultCategories , $top_strQueryData , $top_resultData , $top_strXML ) ; $top_strQueryCategories = " select distinct ZZZZ as TimeStamp FROM nmon.top where ZZZZ = FROM_UNIXTIME(UNIX_TIMESTAMP(ZZZZ) - UNIX_TIMESTAMP(ZZZZ)%(\"$PERIOD\")) and hostname = \"$HOST\" and ZZZZ >= DATE_SUB(current_date(),INTERVAL \"$INTERVAL\" DAY) and CPU_PCT > 5 and Command not like \"%wq%\" group by ZZZZ , Command order by ZZZZ ; "; // Query database $top_resultCategories = mysql_query($top_strQueryCategories) or die(mysql_error()); // SQL query for timeseries data $top_strQueryData = " select Command as Process, ZZZZ as TimeStamp , CPU_PCT FROM nmon.top where ZZZZ = FROM_UNIXTIME(UNIX_TIMESTAMP(ZZZZ) - UNIX_TIMESTAMP(ZZZZ)%(\"$PERIOD\")) and hostname = \"$HOST\" and ZZZZ >= DATE_SUB(current_date(),INTERVAL \"$INTERVAL\" DAY) and CPU_PCT > 5 and Command not like \"%wq%\" group by Command ,ZZZZ order by Command "; // Query database $top_resultData = mysql_query($top_strQueryData) or die(mysql_error()); //We also keep a flag to specify whether we have to animate the chart or not. //If the user is viewing the detailed chart and comes back to this page, he should not //see the animation again. //$strXML will be used to store the entire XML document generated //Generate the chart element $top_strXML = "<graph bgColor='CCCCCC' showBorder='1' showLabel='1' caption='TOP cpu processes for host : $HOST for last $INTERVAL day(s) ' subCaption='Every $PERIODmin Mins' xAxisName='TimeLine' yAxisName='CPU UTIL %' showValues='0' formatNumberScale='0' rotateValues='1' animation='1' interactiveLegend='1' showSum='1' showToolTip='1' labelDisplay='rotate' >"; // Build category XML $top_strXML .= buildCategories ($top_resultCategories, "TimeStamp"); // Build datasets XML // function buildDatasets ($result, $valueField, $controlBreak ) $top_strXML .= buildDatasets ( $top_resultData,"CPU_PCT" ,"Process" ); //Finally, close <chart> element $top_strXML .= "</graph>"; //Create the chart - MSLINE 3D Chart with data from strXML // FC_SetRenderer("javascript"); // echo renderChart("Charts/StackedColumn3D.swf", "", $top_strXML, "TOP", 1200, 600, false, true); echo renderChart("Charts/ScrollStackedColumn2D.swf", "", $top_strXML, "TOP", 1200, 600, false, true); // Free database resource mysql_free_result($top_resultCategories); mysql_free_result($top_resultData); Thanks in advance , any suggestions welcome.. mpaul Share this post Link to post Share on other sites
mpaul Report post Posted December 28, 2012 We are testing the fusion charts trial version for our sysadmin graphs . Facing issues with displaying all the data points for all the items . Background: We have captured the nmon output into mysql tables and my query shows all the data points for each control break. Issue : When I render using ScrollStackedColumn2D.swf it only displays a part of the data. Is this because this is the Trial Version .. how to test /view the data showing up all across the time line.. here// I need to test out all the aspects before we can proceed to purchase .. Snip : please note the rsync values : which shows perfectly on the left sides here. ( chart_left.jpg ) but vanishes when I scroll to the right ..(chart_right.jpg ) The mysql data from query looks like : query : select Command as Process, ZZZZ as TimeStamp , CPU_PCT FROM nmon.top where ZZZZ = FROM_UNIXTIME(UNIX_TIMESTAMP(ZZZZ)- UNIX_TIMESTAMP(ZZZZ)%(30*60)) and hostname = 'wkr-sybase01' and ZZZZ >= DATE_SUB(current_date(),INTERVAL 3 DAY) and Command not like '%wq%'[attachment=5778:chart_left.JPG] and CPU_PCT > 5 group by Command ,ZZZZ order by Command ; output : data jpg php code : // SQL query for category labels unset ( $top_strQueryCategories ,$top_resultCategories , $top_strQueryData , $top_resultData , $top_strXML ) ; $top_strQueryCategories = " select distinct ZZZZ as TimeStamp FROM nmon.top where ZZZZ = FROM_UNIXTIME(UNIX_TIMESTAMP(ZZZZ) - UNIX_TIMESTAMP(ZZZZ)%(\"$PERIOD\")) and hostname = \"$HOST\" and ZZZZ >= DATE_SUB(current_date(),INTERVAL \"$INTERVAL\" DAY) and CPU_PCT > 5 and Command not like \"%wq%\" group by ZZZZ , Command order by ZZZZ ; "; // Query database $top_resultCategories = mysql_query($top_strQueryCategories) or die(mysql_error()); // SQL query for timeseries data $top_strQueryData = " select Command as Process, ZZZZ as TimeStamp , CPU_PCT FROM nmon.top where ZZZZ = FROM_UNIXTIME(UNIX_TIMESTAMP(ZZZZ) - UNIX_TIMESTAMP(ZZZZ)%(\"$PERIOD\")) and hostname = \"$HOST\" and ZZZZ >= DATE_SUB(current_date(),INTERVAL \"$INTERVAL\" DAY) and CPU_PCT > 5 and Command not like \"%wq%\" group by Command ,ZZZZ order by Command "; // Query database $top_resultData = mysql_query($top_strQueryData) or die(mysql_error()); //We also keep a flag to specify whether we have to animate the chart or not. //If the user is viewing the detailed chart and comes back to this page, he should not //see the animation again. //$strXML will be used to store the entire XML document generated //Generate the chart element $top_strXML = "<graph bgColor='CCCCCC' showBorder='1' showLabel='1' caption='TOP cpu processes for host : $HOST for last $INTERVAL day(s) ' subCaption='Every $PERIODmin Mins' xAxisName='TimeLine' yAxisName='CPU UTIL %' showValues='0' formatNumberScale='0' rotateValues='1' animation='1' interactiveLegend='1' showSum='1' showToolTip='1' labelDisplay='rotate' >"; // Build category XML $top_strXML .= buildCategories ($top_resultCategories, "TimeStamp"); // Build datasets XML // function buildDatasets ($result, $valueField, $controlBreak ) $top_strXML .= buildDatasets ( $top_resultData,"CPU_PCT" ,"Process" ); //Finally, close <chart> element $top_strXML .= "</graph>"; //Create the chart - MSLINE 3D Chart with data from strXML // FC_SetRenderer("javascript"); // echo renderChart("Charts/StackedColumn3D.swf", "", $top_strXML, "TOP", 1200, 600, false, true); echo renderChart("Charts/ScrollStackedColumn2D.swf", "", $top_strXML, "TOP", 1200, 600, false, true); // Free database resource mysql_free_result($top_resultCategories); mysql_free_result($top_resultData); Thanks in advance , any suggestions welcome.. mpaul Attaching 2 more snips of the same data timeline.. Share this post Link to post Share on other sites
Guest Bindhu Report post Posted December 29, 2012 Hi, A warm welcome to the FusionCharts Forum Can you please share the generated XML data for testing purposes? Also, please let us know the version of FusionCharts Suite that you are currently using. Share this post Link to post Share on other sites
mpaul Report post Posted December 31, 2012 Thanks.. Looks to be a issue with discontinuous data points I just could copy out the xml part from page source . into the attached txt file data.txt I tried using the SimpleXMLElement to var_dump the xml string.. but to no avail. I am using this code from the code examples to create my str_XML /*********************************************************************************************** * Function to build XML for datasets that will contain chart data * @param $result Database resource. The data should come ordered by a control break field which will require to identify datasets and set its value to dataset's series name * @param $valueField Field name as String that contains value for chart dataplots * @param $controlBreak Field name as String that contains value for chart dataplots * * @return Dataset XML node */ function buildDatasets ($result, $valueField, $controlBreak ) { $strXML = ""; if ($result) { $controlBreakValue =""; while( $ors = mysql_fetch_array($result) ) { if( $controlBreakValue != $ors[$controlBreak] ) { $controlBreakValue = $ors[$controlBreak]; $strXML .= ( $strXML =="" ? "" : "</dataset>") . ( "<dataset seriesName='" . $controlBreakValue ."' color='" . getFCColor() . "'>" ) ; } $strXML .= "<set value='" . $ors[$valueField] . "'/>"; } $strXML .= "</dataset>"; } return $strXML; } Share this post Link to post Share on other sites
mpaul Report post Posted December 31, 2012 In short the data for the rsync looks like : <dataset seriesName='rsync' color='FF0000'> <set value='98.89'/><set value='99.29'/> <set value='99.95'/><set value='99'/><set value='97.91'/> <set value='98.98'/><set value='98.89'/><set value='98.9'/> <set value='97.92'/><set value='98.99'/><set value='97.94'/> <set value='99.02'/><set value='99.83'/><set value='99.93'/> <set value='98.96'/><set value='99.93'/><set value='99.95'/>' <set value='99.97'/><set value='99.87'/><set value='97.89'/> <set value='97.94'/><set value='98.89'/><set value='97.89'/> <set value='98.78'/> Share this post Link to post Share on other sites
mpaul Report post Posted January 3, 2013 In short the data for the rsync looks like : <dataset seriesName='rsync' color='FF0000'> <set value='98.89'/><set value='99.29'/> <set value='99.95'/><set value='99'/><set value='97.91'/> <set value='98.98'/><set value='98.89'/><set value='98.9'/> <set value='97.92'/><set value='98.99'/><set value='97.94'/> <set value='99.02'/><set value='99.83'/><set value='99.93'/> <set value='98.96'/><set value='99.93'/><set value='99.95'/>' <set value='99.97'/><set value='99.87'/><set value='97.89'/> <set value='97.94'/><set value='98.89'/><set value='97.89'/> <set value='98.78'/> Share this post Link to post Share on other sites
mpaul Report post Posted January 3, 2013 So I turned on the debug for the chart and it shows the version to be Version: 3.2.2(XT) and here's the dump from the debug screen . data_new.txt I would really appreciate any help on this. data_new.txt Share this post Link to post Share on other sites
Guest Sumedh Report post Posted January 4, 2013 Hi, Apologies for the delayed response. From the chart XML, you are rendering "dataserver" series with 191 <set> elements. And other data series have lesser number of <set> elements, Hence when you scroll, you will be able to see the data-plots of data-server series only. So, this is not an issue. Chart is rendering fine. Also, there are no limitations in Trial version. You can implement all the features but there will be a watermark on the charts. Hope this helps! Share this post Link to post Share on other sites
mpaul Report post Posted January 4, 2013 The problem is that the individual elements are not plotting as per time line. So" rysnc" element items happening at 2 AM each day does not plot for all the 3 days in the timeline . It plots only of the one day on the left ( i.e. first day in the time line and does not show up at the other two days at the same time slot ( 2Am to say 4 AM ) in the time line. The data shows that it exists in the xml dump too. This data as you see is discontinuous unlike the dataserver item which exists all across the time line since its the main process on this host etc. Interestingly enough the behavior is same for any number of days you choose .. so its correct for 1 day and does not work for any extended period of days after that . So my graph is correct if my date interval f is 1 days in my mysql query., Trying to explain the chart in words :- Time line -> day 1 ( 12 Am -> 11:59:59 Pm ) -------- day 2 ( 12 Am -> 11:59:59 Pm ) ------ day 3 ( 12 Am -> 11:59:59 Pm ) ------------ Items ( stacked below ) Dataserver ------------- exists ------------------------------------------- exists ------------------------------ exists ( all cross the time lines ) and does show up in the chart sshd ------------ exists (2am to 5 AM ) ------------------------- exists (2am to 5 AM ) ------------------ exists (2am to 5 AM ) ---------------------------- shows up for 1 day in the chart rsync ------------- exists (2am to 3:30 AM ) ------------------ exists (2am to 3:30 AM ) -------------- exists (2am to 3:30 AM ) ---------------------- shows up for 1 day in the chart So sshd and sync is not getting plotted in its time periods each day. ( i.e. it does only show up for the first day and not the other days in the time periods as it occurred ) I hope I could explain the issue now. Share this post Link to post Share on other sites