PieChart   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 14
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A chartType() 0 3 1
A makePalette() 0 7 1
1
<?php
2
namespace rtens\domin\delivery\web\renderers\charting\charts;
3
4
use rtens\domin\parameters\Color;
5
6
class PieChart extends DataPointChart {
7
8
    public function chartType() {
9
        return 'Pie';
10
    }
11
12
    public function makePalette(Color $color) {
13
        list($red, $green, $blue) = $color->asArray();
14
        return [
15
            'color' => "rgba($red,$green,$blue,1)",
16
            'highlight' => "rgba($red,$green,$blue,0.8)",
17
        ];
18
    }
19
}