--- ./openflashchart/openflashchart.inc 2009-05-15 06:30:53.000000000 +0100 +++ ../charts_patched/openflashchart/openflashchart.inc 2010-02-05 11:13:01.000000000 +0000 @@ -15,10 +15,15 @@ * Array. The raw data. */ function _openflashchart_chart(&$chart, &$data) { - $chart->set_title($data['#title']); + if ($data['#title-size']){ + $chart->set_title($data['#title'],'{font-size: '.$data['#title-size'].'px;}'); + } + else { + $chart->set_title($data['#title'],'{font-size: 20px;}'); + } $chart->set_width($data['#width']); $chart->set_height($data['#height']); $chart->set_bg_colour($data['#color']['#background']); } /** @@ -58,7 +63,7 @@ switch ($data['#type']) { case 'line2D': - $chart->line(1, $color); + $chart->line(1, $color,$data[$series]['#legend'], 10); break; case 'vbar2D': @@ -89,20 +94,24 @@ } function _openflashchart_series_generic(&$chart, &$data, $series) { - static $max; + if (!empty($series)){static $max;} // Get only the numeric values from the series $series_data = _charts_series_values($data[$series]); $chart->set_data($series_data); - // Get the highest value on the series, to be a reference point + // Get the highest value on the series add 5%, to be a reference point $max = $max < max($series_data) ? max($series_data) : $max; - + $max=$max+($max/20); // Y labels $chart->set_y_max($max); + //set title for up offset + if(!$chart->title))$chart->title(' '); // X labels + if (!empty($data['#x-steps'])){ + $chart->set_x_axis_steps($data['#x-steps']); + } + $value_labels = array(); $toogle = FALSE; foreach (array_keys($series_data) as $value) { @@ -111,12 +120,22 @@ } else { $value_labels[] = $data[$series][$value]['#label']; - $toogle = TRUE; + $toogle = TRUE; } } - if (!empty($toogle)) { + if (!empty($toogle) && empty($data['#no-x-labels'])){ $chart->set_x_labels($value_labels); + if (!empty($data['#no-x-axis-labels'])){ + $chart->set_x_label_style(0,$data['#color']); + } + } + if (!empty($data['#x-legend'])){ + $chart->set_x_legend($data['#x-legend'],10); + } + if (!empty($data['#y-legend'])){ + $chart->set_y_legend($data['#y-legend'],10); } + } function _openflashchart_series_pie(&$chart, &$data, $series) {