basic6.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. require_once 'bootstrap.php';
  3. //random data as X=>array of Y
  4. $data = array();
  5. //$data['uno']=array(1,2,3,4,5,6,7,8,9,10,11,12);
  6. //$data['dos']=array(1,2,3,4,5,6,7,8,9,10,11,12);
  7. $data['tres']=array(13,1,12,12,12,12,12,12,12,12,13,12);
  8. $legend=array('total','icmp','udp','tcp','mail','dns','vpn','ftp','web','proxy','quic','sip');
  9. $colorOverrides = array(
  10. 1 => array('r' => 240, 'g' => 0, 'b' => 0),
  11. 2 => array('r' => 140, 'g' => 0, 'b' => 0),
  12. 3 => array('r' => 0, 'g' => 220, 'b' => 0),
  13. 5 => array('r' => 252, 'g' => 93, 'b' => 0),
  14. 6 => array('r' => 240, 'g' => 240, 'b' => 0),
  15. 7 => array('r' => 174, 'g' => 174, 'b' => 174),
  16. 8 => array('r' => 0, 'g' => 0, 'b' => 245),
  17. 11 => array('r' => 54, 'g' => 49, 'b' => 22),
  18. );
  19. $chartMancer->setDrawFirstColumn(true);
  20. $chartMancer->setPalette('OphanimFlow');
  21. $chartMancer->setOverrideColors($colorOverrides);
  22. $chartMancer->setDebug(true);
  23. $chartMancer->setChartLegend($legend);
  24. $chartMancer->setChartYaxisName('Mbit/s');
  25. $chartMancer->setDisplayPeakValue(true);
  26. $chartMancer->renderChart($data);