0 Members and 2 Guests are viewing this topic.
$g->title................;
$g->bg_colour = '#FFFFFF';
$g->x_axis_colour( '#000', '#000' );$g->y_axis_colour( '#000', '#000' );
$g->set_data($data_array);
$g->line_dot( 2, 4, '#C0C0C0', '', 10 );
I've got some graphs to work but can't figure out how to auto reload the graphsThe grahs are here: http://www.shermanctweather.com/graph.php
<script> var timerID = 0; function reload() { if (timerID) { clearTimeout(timerID); } tmp = findSWF("chart"); /* view your webpage's source to see chart's ID - id="chart" */ tmp2 = findSWF("chart_2"); /* view your webpage's source to see chart's ID - id="chart_2" */ <?php echo 'x = tmp.reload("chart-outside-temp.php?lang='.$lang.'");' ?> /* reload the first chart with the good language */ <?php echo 'x = tmp2.reload("chart-outside-temp2.php?lang='.$lang.'");' ?> /* reload the second chart with the good language */ timerID = setTimeout("reload()", 5000); } function findSWF(movieName) { if (navigator.appName.indexOf("Microsoft")!= -1) { return window["ie_" + movieName]; //add ie_ for Internet Explorer browser } else { return document[movieName]; } } timerID = setTimeout("reload()", 5000);</script>
<?php$lang_ok = array('fr', 'en'. 'Den'); //authorized languages array - add your own languages here - create corresponding folders and files !if(!isset( $_GET['lang'] ) ) $_GET['lang'] = "en"; //set $lang to "en" if nothing is define in the url - prevent "Undefined index" message from phpif (in_array($_GET['lang'], $lang_ok)) //test if the language is in authorized array { $lang = $_GET["lang"]; } else { $lang = "Den"; //define "en" by default, if $lang have a different value than one in the authorized languages array }include_once "./lang/".$lang."/labels.php"; //include language file (english is default)include_once "./clientraw_data.php"; //include datas from clientraw files//use the chart class to build the chart:include_once( './php-ofc-library/open-flash-chart.php' );//declare news graph$g = new graph();//graph title$g->title( $labels_clientraw['79'], '{color: #CCCCCC; font-size: 20; text-align: center}' );$g->bg_colour = '#FFFFFF';$data_array = array( $data_clientrawextra['511'],$data_clientrawextra['512'],$data_clientrawextra['513'],$data_clientrawextra['514'],$data_clientrawextra['515'],$data_clientrawextra['516'],$data_clientrawextra['517'],$data_clientrawextra['518'],$data_clientrawextra['519'],$data_clientrawextra['520'],$data_clientrawextra['521'],$data_clientrawextra['522'],$data_clientrawextra['523'],$data_clientrawextra['524'],$data_clientrawextra['525'],$data_clientrawextra['526'],$data_clientrawextra['527'],$data_clientrawextra['528'],$data_clientrawextra['529'],$data_clientrawextra['530'],$data_clientrawextra['586'],$data_clientrawextra['587'],$data_clientrawextra['588'],$data_clientrawextra['589']);$g->set_data($data_array);//$current_hour = date('H:i');//date('H:i', strtotime($current_hour."-1 hour"));$labels_array = array($data_clientrawextra['459'],$data_clientrawextra['460'],$data_clientrawextra['461'],$data_clientrawextra['462'],$data_clientrawextra['463'],$data_clientrawextra['464'],$data_clientrawextra['465'],$data_clientrawextra['466'],$data_clientrawextra['467'],$data_clientrawextra['468'],$data_clientrawextra['469'],$data_clientrawextra['470'],$data_clientrawextra['471'],$data_clientrawextra['472'],$data_clientrawextra['473'],$data_clientrawextra['474'],$data_clientrawextra['475'],$data_clientrawextra['476'],$data_clientrawextra['477'],$data_clientrawextra['478'],$data_clientrawextra['578'],$data_clientrawextra['579'],$data_clientrawextra['580'],$data_clientrawextra['581']);$g->set_x_labels($labels_array);$g->set_x_label_style( 10, 0, 2 );//set the X and Y legend$g->set_x_legend( $today, 12, '#CCCCCC' );$g->set_y_legend( 'UV-Index', 12, '#CCCCCC' );$g->line_dot( 2, 4, '#818D9D', '', 10 );$g->x_axis_colour( '#OOOOOO', '#F0F0F0' );$g->y_axis_colour( '#OOOOOO', '#ADB5C7' );$g->y_right_axis_colour( '#164166' );//set the Y min and max$ymin = round(min($data_array)); //get the min outside temp$ymax = round(max($data_array)); //get the max outside temp$g->set_y_min( $ymin );$g->set_y_max( $ymax+1 );//label y every 1$ylabelstep = ($ymax+1)-($ymin);$g->y_label_steps( $ylabelstep );// display the dataecho $g->render();?>
<?php$lang_ok = array('fr', 'en'. 'Den'); //authorized languages array - add your own languages here - create corresponding folders and files !if(!isset( $_GET['lang'] ) ) $_GET['lang'] = "en"; //set $lang to "en" if nothing is define in the url - prevent "Undefined index" message from phpif (in_array($_GET['lang'], $lang_ok)) //test if the language is in authorized array { $lang = $_GET["lang"]; } else { $lang = "Den"; //define "en" by default, if $lang have a different value than one in the authorized languages array }include_once "./lang/".$lang."/labels.php"; //include language file (english is default)include_once "./clientraw_data.php"; //include datas from clientraw files//use the chart class to build the chart:include_once( './php-ofc-library/open-flash-chart.php' );//declare news graph$g = new graph();//graph title$g->title( $labels_clientraw['79'], '{color: #CCCCCC; font-size: 20; text-align: center}' );$g->bg_colour = '#FFFFFF';$data_array = array( $data_clientrawextra['511'],$data_clientrawextra['512'],$data_clientrawextra['513'],$data_clientrawextra['514'],$data_clientrawextra['515'],$data_clientrawextra['516'],$data_clientrawextra['517'],$data_clientrawextra['518'],$data_clientrawextra['519'],$data_clientrawextra['520'],$data_clientrawextra['521'],$data_clientrawextra['522'],$data_clientrawextra['523'],$data_clientrawextra['524'],$data_clientrawextra['525'],$data_clientrawextra['526'],$data_clientrawextra['527'],$data_clientrawextra['528'],$data_clientrawextra['529'],$data_clientrawextra['530'],$data_clientrawextra['586'],$data_clientrawextra['587'],$data_clientrawextra['588'],$data_clientrawextra['589']);$g->set_data($data_array);//$current_hour = date('H:i');//date('H:i', strtotime($current_hour."-1 hour"));$labels_array = array($data_clientrawextra['459'],$data_clientrawextra['460'],$data_clientrawextra['461'],$data_clientrawextra['462'],$data_clientrawextra['463'],$data_clientrawextra['464'],$data_clientrawextra['465'],$data_clientrawextra['466'],$data_clientrawextra['467'],$data_clientrawextra['468'],$data_clientrawextra['469'],$data_clientrawextra['470'],$data_clientrawextra['471'],$data_clientrawextra['472'],$data_clientrawextra['473'],$data_clientrawextra['474'],$data_clientrawextra['475'],$data_clientrawextra['476'],$data_clientrawextra['477'],$data_clientrawextra['478'],$data_clientrawextra['578'],$data_clientrawextra['579'],$data_clientrawextra['580'],$data_clientrawextra['581']);$g->set_x_labels($labels_array);$g->set_x_label_style( 10, 0, 2 );//set the X and Y legend$g->set_x_legend( $today, 12, '#CCCCCC' );$g->set_y_legend( 'UV-Index', 12, '#CCCCCC' );// width: 2px, dots: 3px, area alpha: 25% ...$g->area_hollow( 2, 3, 25, '#CCCCCC' );$g->line_dot( 2, 4, '#818D9D', '', 10 );$g->x_axis_colour( '#OOOOOO', '#F0F0F0' );$g->y_axis_colour( '#OOOOOO', '#ADB5C7' );$g->y_right_axis_colour( '#164166' );//set the Y min and max$ymin = round(min($data_array)); //get the min outside temp$ymax = round(max($data_array)); //get the max outside temp$g->set_y_min( $ymin );$g->set_y_max( $ymax+1 );//label y every 1$ylabelstep = ($ymax+1)-($ymin);$g->y_label_steps( $ylabelstep );// display the dataecho $g->render();?>
You're right.http://www.epa.gov/sunwise/uvcalc.htmlIt seems that we need to round the value.