Table of Contents

Arrow Stroke size

Sets the width of the stroke used to draw arrows. However due to the nature of the api the barb size also has to be set (standard is 10).

JSON

{
  "elements": [
    {
      "type": "line",
      "values": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10
      ]
    },
    {
      "type": "arrow",
      "start": {
        "x": 8,
        "y": 5
      },
      "end": {
        "x": 8,
        "y": 8
      },
      "colour": "#ff0000",
      "barb-length": 10,
      "stroke": 3
    },
    {
      "type": "arrow",
      "start": {
        "x": 6,
        "y": 3
      },
      "end": {
        "x": 6,
        "y": 6
      },
      "colour": "#00ff00",
      "barb-length": 20,
      "stroke": 1
    },
    {
      "type": "arrow",
      "start": {
        "x": 4,
        "y": 1
      },
      "end": {
        "x": 4,
        "y": 4
      },
      "colour": "#0000ff",
      "barb-length": 10,
      "stroke": 1
    }
  ]
}

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));
$chart->add_element( $line_dot );
 
$a = new ofc_arrow(8, 5, 8, 8, '#ff0000', 10, 3);
$chart->add_element( $a );
 
$a = new ofc_arrow(6, 3, 6, 6, '#00ff00', 20, 1);
$chart->add_element( $a );
 
$a = new ofc_arrow(4, 1, 4, 4, '#0000ff', 10, 1);
$chart->add_element( $a );
 
 
echo $chart->toPrettyString();
 
ofc2/features/arrows-stroke.txt · Last modified: 2011/01/29 09:15 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