views:

34

answers:

0

Hi I'm using fusioncharts with PHP. I'm generating the chart from an array like i've shown. I don't get any errors but all I get is no chart but the word "Chart" displayed.

 include ('classes/FusionCharts_Gen.php');

    $ticketobj = new SupportTickets();
    $types = $ticketobj->getIssueTypes();



      $FC = new FusionCharts("Column3D","600","300");

      # Set Relative Path of chart SWF file.
      $FC->setSwfPath("FusionCharts/Charts");

      # Define chart attributes
      $strParam="caption=Tickets by Issue Type;formatNumberScale=0;decimalPrecision=0";

      # Set chart attributes
      $FC->setChartParams($strParam);


      # Call FusionCharts PHP Class Function to add data from the array
      $FC->addChartDataFromArray($types);

      # Render the chart
      $FC->renderChart();

Creating the array

$x = 0;
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC))
{
        $issuetype[$x][0] = $row['issue_type_name'];
        $issuetype[$x][1] = $row['Total'];

       $x++;
}

Var dump of the array

array(6) {
    [0]=> array(2) {
        [0]=> string(14) "Advice Request"
        [1]=> int(14)
    }
    [1]=> array(2) {
        [0]=> string(27) "Application Failure/Problem"
        [1]=> int(37)
    }
    [2]=> array(2) {
        [0]=> string(6) "Backup"
        [1]=> int(3)
    }
    [3]=> array(2) {
        [0]=> string(21) "Device Configuration "
        [1]=> int(14)
    }
    [4]=> array(2) {
        [2]=> string(6) "E-Mail"
        [3]=> int(6)
    }
    [5]=> array(2) {
        [0]=> string(16) "Hardware Failure"
        [1]=> int(4)
    }
}