root/ui/web/htdocs/graph_settings.inc

Revision e7e6b89902c5db31aaaab043f4ae2a67a3211a36, 0.9 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 7 years ago)

sweep, cleaning up graphs

  • Property mode set to 100644
Line 
1 <?php
2 global $graph_settings;
3
4 $fill = 30;
5 $colors[] = '#33aa33';
6 $colors[] = '#4a00dc';
7 $colors[] = '#fadc00';
8 $colors[] = '#3333cc';
9 $colors[] = '#00acfa';
10 $colors[] = '#cc3333';
11
12 function fake_fill($color, $fill) {
13   if(preg_match('/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/',
14                 $color, $octets)) {
15     $o0 = (255 - hexdec($octets[1])) * $fill / 100;
16     $o1 = (255 - hexdec($octets[2])) * $fill / 100;
17     $o2 = (255 - hexdec($octets[3])) * $fill / 100;
18     return sprintf("#%02x%02x%02x", 255 - $o0, 255 - $o1, 255 - $o2);
19   }
20   return $color;
21 }
22
23 for($i=0; $i<100; $i++) {
24   $settings = array();
25   $settings['color_hover'] = fake_fill($colors[$i % count($colors)], 90);
26   $settings['color'] = fake_fill($colors[$i % count($colors)], 80);
27   $settings['fill_color'] = $colors[$i % count($colors)];
28   $settings['fill_alpha'] = $fill;
29   $graph_settings[] = $settings;
30 }
31
Note: See TracBrowser for help on using the browser.