Пример #1
0
$line_sma10->set_width(1);
$line_sma10->set_colour("#DEA325");
$line_sma10->set_key("SMA10", 12);
$line_sma5_default_dot = new dot();
$line_sma5_default_dot->colour('#16AAAF');
$line_sma5 = new line();
$line_sma5->set_default_dot_style($line_sma5_default_dot);
$line_sma5->set_values($sma5);
$line_sma5->set_width(1);
$line_sma5->set_colour("#16AAAF");
$line_sma5->set_key("SMA5", 12);
//print_r($data);
//echo "<br /><br />";
$data = array_reverse($data);
//print_r($data);
$candle = new candle('#134871');
//9933CC
$candle->set_values($data);
$candle->set_tooltip('#x_label#<br>High: #high#<br>Open: #open#<br>Close: #close#<br>Low: #low#');
$y = new y_axis();
$range = $highest - $lowest;
if ($range < 15) {
    $y->set_range(round($lowest - 1), round($highest + 1), 1);
} else {
    if ($range < 100) {
        $y->set_range(round($lowest - 1), round($highest + 1), 5);
    } else {
        $y->set_range(round($lowest - 10, -1), round($highest + 10, -1), 10);
    }
}
$y->set_grid_colour("#E3E3E3");
                if ($price < $low) {
                    $low = $price;
                }
            }
        }
        $open = array_sum($prices) / count($prices);
    } else {
        $price = 0;
        $open = $price;
        $high = $price;
        $low = $price;
    }
    $close = $cat['price'];
    $data[] = new candle_value(number_format($high, 2), number_format($open, 2), number_format($close, 2), number_format($low, 2));
}
$candle = new candle('#FFFF66', '#FFFF66');
$candle->set_values($data);
$candle->set_tooltip('#x_label#<br>Max Price: #high#<br>Ave Price: #open#<br>Act Price: #close#<br>Min Price: #low#');
//$candle->set_key('Product Price (EUR)', 12);
$chart = new open_flash_chart();
$chart->set_bg_colour('#FFFFFF');
/*
$title = new title('Monthly Total VC');
$title->set_style("{font-size: 20px; color: #A2ACBA; text-align: center;}");
$chart->set_title($title);
*/
$chart->add_element($area);
$chart->add_element($area2);
$chart->add_element($area3);
$chart->add_element($candle);
$x_labels = new x_axis_labels();