Smart.Framework Logo

final class \SmartImgGfxCharts
{ } ->

Class: SmartImgGfxCharts - Generates IMG Gfx Charts.


class Methods

public function __construct ( $y_type, $y_title, $y_arr_data, $y_format = "png", $y_display_graph2 = true, $y_display_graph_depths = true ) {} @ 
public function mime_header ( ) {} -> 
public function disposition_header ( $y_filename = "gfx-chart" ) {} -> 
public function generate ( $y_mode = "raw" ) {} -> 

class Properties

public $axis_x ->
public $axis_y ->
public $axis_dec ->
public $tsize ->
public $size ->
public $h3d ->

class Constants


Sample code: PHP

<?php

// Sample Usage:
 //--
    
$chart = new SmartImgGfxCharts(
        
'vbars'// vbars, hbars, dots, lines, pie, donut
        
"Title goes here",
        array(
            array(
                
'x' => "white",
                
'y' => Smart::random_number(10,90),
                
'z' => Smart::random_number(10,90),
                
'w' => 10,
                
'v' => '#ECECEC'
            
),
            array(
                
'x' => "red",
                
'y' => 22.45,
                
'z' => Smart::random_number(10,90),
                
'w' => 25,
                
'v' => '#FF3300'
            
),
            array(
                
'x' => "blue",
                
'y' => Smart::random_number(10,90),
                
'z' => Smart::random_number(10,90),
                
'w' => 7,
                
'v' => '#003399'
            
),
            array(
                
'x' => "yellow",
                
'y' => Smart::random_number(10,90),
                
'z' => Smart::random_number(10,90),
                
'w' => 17,
                
'v' => '#FFCC00'
            
),
            array(
                
'x' => "green",
                
'y' => Smart::random_number(10,90),
                
'z' => Smart::random_number(10,90),
                
'w' => 31,
                
'v' => '#33CC33'
            
),
            array(
                
'x' => "black",
                
'y' => Smart::random_number(10,90),
                
'z' => Smart::random_number(10,90),
                
'w' => 17,
                
'v' => '#333333'
            
)
        ),
        
'png'
    
);
    
$chart->axis_x 'X-Axis';
    
$chart->axis_y 'Y-Axis';
    
//--
    
header('Content-Type: '.$chart->mime_header());
    
header('Content-Disposition: '.$chart->disposition_header());
    echo 
$chart->generate();
 
//--

// #end php code


documentation generated on: 2023-10-19 23:15:59 +0000


Smart.Framework © 2009-2023 unix-world.org