O'Reilly logo

FusionCharts by Shamasis Bhattacharya, Pallav Nadhani, Sanket Nadhani

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — adding drill-down to a database-driven chart

  1. In chart_from_mysql.php, modify this line of code:
    $strXML .= "<set label = '".$row['YEAR']."' value = '".$row['SUM']."' link= 'quarterly_chart_from_mysql.php?year=".$row['YEAR']."'/>";
    
  2. And this line as well:
    $strXML = "<chart caption='Annual Revenue - last 3 years' subCaption='Click on a column to see quarterly revenues for that year' numberPrefix='$'>";
    
  3. Create a blank PHP file named quarterly_chart_from_mysql.php in the same location. Type in the following code:
    <?php include("/Includes/FusionCharts.php"); include("/Includes/DBConn.php"); ?> <html> <head> <title>FusionCharts XT - Rendering drill-down charts from MySQL database</title> <script src="Charts/FusionCharts.js"></script> </head> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required