Umožňuje vytvářet grafy, tj. transformovat data na informace.
Stejná vstupní data mohou být zobrazena 3 rozdílnými výstupními službami:
Zatím neumožňuje zobrazit všechny možnosti, které nabízí modul Open Flash Chart API. ![]()
Další modul:
Podobné moduly:
Příklad grafu:
<?php
$data = array(
'#plugin' => 'openflashchart', //google, openflashchart
'#type' => 'line2D', //openflashchart(line2D, pie2D, vbar2D, vbar3D)
'#width' => '100%',
'#height' => 200, //in pixels
'#title' => t('Testing Chart'), // The chart title
array(
'#legend' => t('Revenue'),
10, 20, 55, 72, 45, 50,
), // First series
array(
'#legend' => t('Profit'),
array('#value' => 35, '#label' => t('Jan')),
array('#value' => 25, '#label' => t('Feb')),
array('#value' => 75, '#label' => t('Mar')),
array('#value' => 50, '#label' => t('Apr')),
array('#value' => 23, '#label' => t('May')),
array('#value' => 12, '#label' => t('Jun')),
), //Second series
); //Charts
return charts_chart($data);
?>
Nastavení barev viz issue 556914:
$data = array(
'#color' => array('#background' => '666'),
array(
array('#value' => 60, '#label' => t('60%'), '#color' => '000'),
array('#value' => 25, '#label' => t('25%'), '#color' => '333'),
array('#value' => 10, '#label' => t('10%'), '#color' => '666'),
array('#value' => 5, '#label' => t('5%'), '#color' => '999'),
),
);
return charts_chart($data);Issue souboru /modules/charts/openflashchart/openflashchart.inc:
Oprava velikosti nadpisu:
$chart->set_title($data['#title'], '{font-size: 20px;}');
Doplnění legendy:
$chart->line(1, $color, $data[$series]['#legend'], 10);
Oprava nastavení barvy pozadí
$chart->set_bg_colour($data['#color']);