Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // header("Content-type: image/png");
- require("../config/connection.php");
- $sql="SELECT COUNT(tanggal) as jlh, tanggal from gempa group by mounth(tanggal)";
- $res = mysqli_query($sql) or die('Sql Sintaks Error...');
- $data1y = array();
- $labels = array();
- $i=0;
- while($row=mysql_fetch_object($result)){
- $jumlah = $row->jlh;
- $tanggal = $row->tanggal;
- $a = substr($tanggal, 5, 2);
- $data1y[$i]=$jumlah;
- $labels[$i]=$a;
- $i++;
- }
- $graph = new Graph(400, 300, 'auto');
- $graph->SetScale('textlin');
- $theme_class = new AquaTheme;
- $graph->SetTheme($theme_class);
- // after setting the theme, you can change individual details yourself
- $graph->SetFrame(true,'lightgray'); // make frame visible and set color
- $graph->xaxis->SetTickLabels($labels); // change xaxis lagels
- $graph->title->Set("Theme Example"); // add title
- // add barplot
- $bplot = new BarPlot($data1y);
- // you can change properties of the plot only after calling Add()
- $bplot->SetWeight(0);
- $bplot->SetFillGradient('#FFAAAA:0.7', '#FFAAAA:1.2', GRAD_VER);
- $graph->Stroke();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement