You are here

function d3_examples_linegraph in d3.js 7

Demonstrates how to create a line graph using the D3 API directly.

1 string reference to 'd3_examples_linegraph'
d3_examples_menu in modules/d3_examples/d3_examples.module
Implements hook_menu().

File

modules/d3_examples/d3_examples.module, line 67
D3 Example module file.

Code

function d3_examples_linegraph() {
  $chart = array(
    'id' => 'visualization',
    'type' => 'linegraph',
    'legend' => array(
      'Development',
      'QA',
      'Strategy',
      'Design',
    ),
    'rows' => array(
      array(
        '1st Quarter 2011',
        10,
        20,
        26,
        35,
      ),
      array(
        '2nd Quarter 2011',
        20,
        26,
        27,
        37,
      ),
      array(
        '3rd Quarter 2011',
        10,
        50,
        28,
        50,
      ),
      array(
        '4th Quarter 2011',
        15,
        76,
        49,
        51,
      ),
      array(
        '1st Quarter 2012',
        20,
        100,
        50,
        52,
      ),
    ),
  );
  return d3_draw($chart);
}