// Add more platforms if you like, when one returns 0 known nodes it is not
// displayed on the stats page.
$platforms = array('Friendica', 'Diaspora', '%%red%%', 'Hubzilla', 'GNU Social', 'StatusNet');
+ $colors = array('Friendica' => '#ffc018', // orange from the logo
+ 'Diaspora' => '#a1a1a1', // logo is black and white, makes a gray
+ '%%red%%' => '#c50001', // fire red from the logo
+ 'Hubzilla' => '#43488a', // blue from the logo
+ 'GNU Social'=> '#a22430', // dark red from the logo
+ 'StatusNet' => '#789240'); // the green from the logo (red and blue have already others
$counts = array();
$total = 0;
// the 3rd array item is needed for the JavaScript graphs as JS does
// not like some characters in the names of variables...
- $counts[$p]=array($c[0], $v, str_replace(array(' ','%'),'',$p));
+ $counts[$p]=array($c[0], $v, str_replace(array(' ','%'),'',$p), $colors[$p]);
}
// some helpful text
<script>
var FedData = [
{{foreach $counts as $c}}
- { value: {{$c[0]['total']}}, label: "{{$c[0]['platform']}}", color: "#90EE90", highlight: "#EE90A1", },
+ { value: {{$c[0]['total']}}, label: "{{$c[0]['platform']}}", color: '{{$c[3]}}', highlight: "#EE90A1", },
{{/foreach}}
];
var ctx = document.getElementById("FederationChart").getContext("2d");
<script>
var {{$c[2]}}data = [
{{foreach $c[1] as $v}}
- { value: {{$v['total']}}, label: '{{$v['version']}}', color: "#90EE90", highlight: "#EE90A1",},
+ { value: {{$v['total']}}, label: '{{$v['version']}}', color: "{{$c[3]}}", highlight: "#EE90A1",},
{{/foreach}}
];
var ctx = document.getElementById("{{$c[2]}}Chart").getContext("2d");