Sign in to follow this  
tutoki

PHP and Combination charts

Recommended Posts

Hi,

 

I am using FusionCharts.php wrapper class to render dimanic html/xml, I have no problem when i try with a Multiseries charts, with Combination Chart (MSCombiDY2D.swf) I try to add some code in the Dataset SerieName like - > ParentYAxis='S' renderAs='Line' and ParentYAxis='P' renderAs='Line'" to change the type of chart without success.

 

this is the snippet

 function buildDatasets ($result, $valueField, $controlBreak ) 
                        {
                            $strXML = "";
                            if ($result) {

                                $controlBreakValue ="";

                                while( $ors = mysql_fetch_array($result) ) 
                                {
                                      // if $controlBreak = "disk.maxtotallatency.latest";
                                       // $controlBreakValue = $controlBreakValue." ParentYAxis='s'";   
                                    if( $controlBreakValue != $ors[$controlBreak] ) 
                                    {
                                        $controlBreakValue =  $ors[$controlBreak];

                                        // this is my own code 
                                        //if ($controlBreakValue == "disk.maxtotallatency.latest") {
                                        //$controlBreakValue .= " ParentYAxis='S' renderAs='Line' ";  }
                                        //if ($controlBreakValue == "disk.usage.average") {
                                        //$controlBreakValue = $controlBreakValue . (" ParentYAxis='P' renderAs='Area'");  }                                   
                                        //End my own code

                                        $strXML .= ( $strXML =="" ? "" : "</dataset>") . ( "<dataset seriesName='" . $controlBreakValue . "'>" ) ;
                                        echo $controlBreakValue;
                                        //echo $controlBreakValue;
                                    }
                                    $strXML .= "<set value='" . $ors[$valueField] . "'/>";

                                }
                                $strXML .= "</dataset>";
                            }
                            return $strXML;

                        }
Any help will be apprecited

SALUD... Charly

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

Yes, you can set all the parameters in the <dataset> element.

 

Ref. Code snippet:

$strXML .= ( $strXML =="" ? "" : "</dataset>") . ( "<dataset seriesName='" . $controlBreakValue . "' ParentYAxis='S' renderAs='Line' >" ) ;

But, by doing this, all the datasets will try to render line plot against secondary axis, which will not work for MSCombiDY2D chart.

 

So, you would need to write condition for which dataset the plot will be line/column.

 

For more information, please visit the link: http://docs.fusioncharts.com/charts/contents/ChartSS/Combi2DDY.html

 

Hope this helps!

Share this post


Link to post
Share on other sites

Hi,

 

Yes, you can set all the parameters in the <dataset> element.

 

Ref. Code snippet:

$strXML .= ( $strXML =="" ? "" : "</dataset>") . ( "<dataset seriesName='" . $controlBreakValue . "' ParentYAxis='S' renderAs='Line' >" ) ;

But, by doing this, all the datasets will try to render line plot against secondary axis, which will not work for MSCombiDY2D chart.

 

So, you would need to write condition for which dataset the plot will be line/column.

 

For more information, please visit the link: http://docs.fusioncharts.com/charts/contents/ChartSS/Combi2DDY.html

 

Hope this helps!

You have shared a great information. I will really help me

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