#8 Y axis range bug

version-1
open
nobody
None
5
2008-06-11
2007-09-10
Anonymous
No

Hello,
I have noticed a bug in y axis range setting in version 1.9.3. Labels on y axis are sometimes shifted one tick up so the min value is not at axes cross and the max value does not appear at all. And also the data lines does not match grid legend.
I enclose simplified examples of PHP code for generating chart object and data and generated chart data with image as well.
Best regards
Tomáš Valenta
vali@kamarad.cz

chart.php
---------
<html>
<head><title>Chart</title></head>
<body>
<?php
include_once('php-ofc-library/open_flash_chart_object.php');
open_flash_chart_object(490, 210, "chartdata.php", false);
?>
</body>
</html>

chartdata.php
-------------
<?php
$data = array(1.527, 1.550, 1.515, 1.505, 1.487, 1.476, 1.472, 1.458, 1.448, 1.448, 'null', 'null');
$months = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
$min = 1.448; $min = floor($min);
$max = 1.527; $max = ceil($max);
include_once('php-ofc-library/open-flash-chart.php');
$g = new graph();
$g->bg_colour = '#D0D0D0';
$g->x_axis_colour('#000000', '#FFFFFF');
$g->y_axis_colour('#000000', '#FFFFFF');
$g->title("BG 2007", '{font-size: 17.5px;}');
$g->set_data($data);
$g->line_dot(2, 4, '0x0000a0', '', 10);
$g->set_x_labels($months);
$g->set_x_label_style(12, '0x000000', 2);
$g->set_y_label_style(12, '0x000000', 2);
$g->set_y_min($min);
$g->set_y_max($max);
$g->y_label_steps(6);
echo $g->render();
?>

result of chartdata.php
-----------------------
&title=BG 2007,{font-size: 17.5px;}&
&x_label_style=12,0x000000,2&
&x_axis_steps=1&
&y_label_style=12,0x000000&y_ticks=5,10,6&
&line_dot=2,0x0000a0,,10,4&
&values=1.527,1.55,1.515,1.505,1.487,1.476,1.472,1.458,1.448,1.448,null,null&
&x_labels=January,February,March,April,May,June,July,August,September,October,November,December&
&y_min=1&
&y_max=2&
&bg_colour=#D0D0D0&
&x_axis_colour=#000000&
&x_grid_colour=#FFFFFF&
&y_axis_colour=#000000&
&y_grid_colour=#FFFFFF&

Discussion

  • Nobody/Anonymous

    Visual result of chart data

     
  • John Vandervort

    John Vandervort - 2008-06-11
    • milestone: --> version-1
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks