Table of Contents

Logarithmic Scale

Sets the y-axis to use a logarithmic scale

JSON

{
  "elements": [
    {
      "type": "line",
      "values": [
        1,
        10,
        100,
        1000,
        10000,
        100000
      ],
      "axis": "right"
    }
  ],
  "y_axis_right": {
    "min": 0,
    "max": 200000,
    "steps": 10000,
    "log-scale": true
  }
}

PHP

$chart = new open_flash_chart();
 
 
$line_dot = new line();
$line_dot->set_values( array(1,10,100,1000,10000,100000) );
$line_dot->attach_to_right_y_axis();
 
 
$chart->add_element( $line_dot );
$y = new y_axis_right();
// grid steps:
$y->set_range( 0, 200000, 10000);
$y->set_logScale( true );
 
//
// Add the Y Axis object to the chart:
//
$chart->set_y_axis_right( $y );
 
echo $chart->toPrettyString();
 
ofc2/features/axis-log_scale.txt · Last modified: 2011/01/29 08:45 by etw
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki