<?php
include_once "environment.php";
use phpRGraph\rgraph_chart;
use phpRGraph\rgraph_options;
// rgraph chart
$template = "default.php";
$draw_option = "draw();";
$width = "800";
$height = "350";
$url = "http://www.jschmidt-systemberatung.de" . $tmp[0] . "/samples/sinus.php";
$chart = new rgraph_chart("cvs", null, "Line");
$url_data = $chart->getDataFromUrl($url);
$chart->set_data($url_data['data']);
$options = new rgraph_options("default.ini");
$options->set_option("title", "A Line Chart with Data from URL \n" . $url);
$options->set_option("titleY",20);
$options->set_option("yaxisScaleMax", (float)1);
$options->set_option("yaxisScaleDecimals",2);
$options->set_option("xaxisPosition", "center");
$options->set_option("outofbounds", true);
$labels = $url_data['labels'];
$options->set_option("xaxisLabels", $labels);
$options->set_option("xaxisTickmarksCount", 8);
$options->set_option("backgroundGridVlinesCount", 16);
$options->set_option("filled", true);
$options->set_option("filledColors", array($options->setOpacity("#00BFFF",0.3)));
$options->set_tooltip($url_data['data'], "X=#label# value=#val# ");
$labels = $options->xlabelsteps($url_data['labels'],9);
$options->set_option("xaxisLabels", $labels);
$chart->set_options($options);
$rgraph_json = $chart->toString();
$chart_script = "";
$event_script = "";
include_once ($templates . $template);
?>