Table of Contents

Legend position settings

Allows users to set the position of the legend to 'top' or 'right'

JSON

{
  "elements": [
    {
      "type": "line",
      "values": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10
      ],
      "text": "line 1",
      "colour": "#ff0000"
    }
  ],
  "legend": {
    "position": "right",
    "visible": true
  }
}

PHP

$chart = new open_flash_chart();
 
$line_dot = new line();
$line_dot->set_values( array(0,1,2,3,4,5,6,7,8,9,10));
$line_dot->set_text( "line 1" );
$line_dot->set_colour( '#ff0000' );
$chart->add_element( $line_dot );
 
$legend = new legend();
$legend->set_position("right");
$legend->set_visible(true);
$chart->set_legend( $legend );
 
ofc2/features/legend-position.txt · Last modified: 2011/01/29 09:05 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