35 $this->line_width = $a_value;
50 $this->label_radius = $a_value;
58 public function addPiePoint(
int $a_value, ?
string $a_caption =
null): void
60 $this->data[] = array($a_value, $a_caption);
65 foreach ($this->data as $slice) {
66 $series =
new stdClass();
67 $series->label = str_replace(
"\"",
"\\\"", $slice[1]);
71 $series->label .=
" (" . $slice[0] .
"%)";
74 $series->data = $slice[0];
76 $options = array(
"show" => !$this->
isHidden());
86 $a_options->series->pie =
new stdClass();
87 $a_options->series->pie->show =
true;
91 $fill = $this->getFill();
92 $width = $this->getLineWidth();
93 if ($fill[
"fill"] || $width) {
94 $a_options->series->pie->stroke =
new stdClass();
96 $a_options->series->pie->stroke->width = $width;
103 $radius = $this->getLabelRadius();
105 $a_options->series->pie->label =
new stdClass();
106 $a_options->series->pie->label->background =
new stdClass();
107 $a_options->series->pie->radius = 1;
108 $a_options->series->pie->label->radius = $radius;
109 $a_options->series->pie->label->show =
true;
110 $a_options->series->pie->label->background->color =
"#444";
111 $a_options->series->pie->label->background->opacity = 0.8;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLineWidth(int $a_value)
parseData(array &$a_data)
Convert data to flot config.
parseGlobalOptions(stdClass $a_options, ilChart $a_chart)
Convert (global) properties to flot config.
addPiePoint(int $a_value, ?string $a_caption=null)
setLabelRadius(float $a_value)
Sets the radius at which to place the labels.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static renderColor(string $a_value, float $a_opacity=1)
Render html color code.