4include_once 
"Services/Chart/classes/class.ilChartLegend.php";
 
   43        $this->tpl = 
$DIC[
"tpl"];
 
   45        $this->
data = array();
 
   61                include_once 
"Services/Chart/classes/class.ilChartGrid.php";
 
   65                include_once 
"Services/Chart/classes/class.ilChartPie.php";
 
   69                include_once 
"Services/Chart/classes/class.ilChartSpider.php";
 
   95        if (
sizeof($this->
data)) {
 
  110        $this->height = $a_y;
 
  123            if ($a_idx === 
null) {
 
  126            $this->
data[$a_idx] = $a_series;
 
  138        $this->legend = $a_legend;
 
  148        foreach ($a_values as $color) {
 
  149            if (self::isValidColor($color)) {
 
  150                $this->colors[] = $color;
 
  173        if (preg_match(
"/^#[0-9a-f]{3}$/i", $a_value, $match)) {
 
  175        } elseif (preg_match(
"/^#[0-9a-f]{6}$/i", $a_value, $match)) {
 
  189        if (self::isValidColor($a_value)) {
 
  190            if (strlen($a_value) == 4) {
 
  191                return "rgba(" . hexdec($a_value[1] . $a_value[1]) . 
", " .
 
  192                    hexdec($a_value[2] . $a_value[2]) . 
", " .
 
  193                    hexdec($a_value[3] . $a_value[3]) . 
", " . $a_opacity . 
")";
 
  195                return "rgba(" . hexdec($a_value[1] . $a_value[2]) . 
", " .
 
  196                    hexdec($a_value[3] . $a_value[4]) . 
", " .
 
  197                    hexdec($a_value[5] . $a_value[6]) . 
", " . $a_opacity . 
")";
 
  209        $this->shadow = (int) $a_value;
 
  229        $this->auto_resize = (bool) $a_value;
 
  239        $this->stacked = (bool) $a_value;
 
  249        include_once 
"Services/jQuery/classes/class.iljQueryUtil.php";
 
  252        $tpl->addJavascript(
"Services/Chart/js/flot/excanvas.min.js");
 
  253        $tpl->addJavascript(
"Services/Chart/js/flot/jquery.flot.min.js");
 
  255        if ((
bool) $this->auto_resize) {
 
  257            $tpl->addJavascript(
"Services/Chart/js/flot/jquery.flot.resize.min.js");
 
  260        if ((
bool) $this->stacked) {
 
  261            $tpl->addJavascript(
"Services/Chart/js/flot/jquery.flot.stack.min.js");
 
  295        $chart->setVariable(
"ID", $this->
id);
 
  298            if (is_numeric($this->width)) {
 
  299                $chart->setVariable(
"WIDTH", 
"width:" . $this->width . 
"px;");
 
  301                $chart->setVariable(
"WIDTH", 
"width:" . $this->width . 
";");
 
  305            if (is_numeric($this->height)) {
 
  306                $chart->setVariable(
"HEIGHT", 
"height:" . $this->height . 
"px;");
 
  308                $chart->setVariable(
"HEIGHT", 
"height:" . $this->height . 
";");
 
  315        $json_series = array();
 
  317            $series->parseData($json_series);
 
  319        $chart->setVariable(
"SERIES", json_encode($json_series));
 
  324        $json_options = 
new stdClass();
 
  325        $json_options->series = 
new stdClass();
 
  326        $json_options->series->shadowSize = (int) $this->
getShadow();
 
  327        $json_options->series->lines = 
new stdClass();
 
  328        $json_options->series->lines->show = 
false;
 
  329        $json_options->series->stack = (bool) $this->stacked;
 
  332            $series->parseGlobalOptions($json_options, $this);
 
  339            $json_options->colors = array();
 
  346        $json_options->legend = 
new stdClass();
 
  347        if (!$this->legend) {
 
  348            $json_options->legend->show = 
false;
 
  350            $this->legend->parseOptions($json_options->legend);
 
  353        $chart->setVariable(
"OPTIONS", json_encode($json_options));
 
An exception for terminatinating execution or to throw for unit testing.
Abstract chart data series base class.
Generator for grid-based charts.
Generator for pie charts.
Generator for spider charts.
Abstract Chart generator base class.
setColors($a_values)
Set colors.
isValidDataType(ilChartData $a_series)
Validate data series.
initJS()
Init JS script files.
static getInstanceByType($a_type, $a_id)
Get type instance.
setLegend(ilChartLegend $a_legend)
Set chart legend.
addData(ilChartData $a_series, $a_idx=null)
Add data series.
static renderColor($a_value, $a_opacity=1)
Render html color code.
setStacked($a_value)
Toggle stacking.
setShadow($a_value)
Set shadow.
setSize($a_x, $a_y)
Set chart size.
static isValidColor($a_value)
Validate html color code.
__construct($a_id)
Constructor.
isValid()
Basic validation.
getDataInstance($a_type=null)
Get data series instance.
setAutoResize($a_value)
Toggle auto-resizing on window resize/redraw.
parseGlobalOptions(stdClass $a_options)
Convert (global) properties to flot config.
addCustomJS()
Add type-specific JS script.
special template class to simplify handling of ITX/PEAR
static initjQuery($a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template