diff --git a/library/Icinga/Chart/Graph/BarGraph.php b/library/Icinga/Chart/Graph/BarGraph.php index ecde65c5e..adef42894 100644 --- a/library/Icinga/Chart/Graph/BarGraph.php +++ b/library/Icinga/Chart/Graph/BarGraph.php @@ -142,7 +142,6 @@ class BarGraph extends Styleable implements Drawable // draw actual bar $bar = $this->drawSingleBar($point, $this->fill, $this->strokeWidth)->toSvg($ctx); - $bar->setAttribute('class', 'chart-data'); if (isset($this->tooltips[$x])) { $data = array( 'label' => isset($this->graphs[$this->order]['label']) ? @@ -152,14 +151,9 @@ class BarGraph extends Styleable implements Drawable ); $format = isset($this->graphs[$this->order]['tooltip']) ? $this->graphs[$this->order]['tooltip'] : null; - $bar->setAttribute( - 'title', - $this->tooltips[$x]->renderNoHtml($this->order, $data, $format) - ); - $bar->setAttribute( - 'data-title-rich', - $this->tooltips[$x]->render($this->order, $data, $format) - ); + $title = $ctx->getDocument()->createElement('title'); + $title->textContent = $this->tooltips[$x]->renderNoHtml($this->order, $data, $format); + $bar->appendChild($title); } $group->appendChild($bar); } diff --git a/library/Icinga/Chart/Graph/LineGraph.php b/library/Icinga/Chart/Graph/LineGraph.php index 18c1eaac8..6954c596f 100644 --- a/library/Icinga/Chart/Graph/LineGraph.php +++ b/library/Icinga/Chart/Graph/LineGraph.php @@ -170,11 +170,10 @@ class LineGraph extends Styleable implements Drawable } // Draw invisible circle for tooltip hovering - $invisible = new Circle($point[0], $point[1], 20); - $invisible->setFill($this->strokeColor); - $invisible->setAdditionalStyle('opacity: 0.0;'); - $invisible->setAttribute('class', 'chart-data'); if (isset($this->tooltips[$x])) { + $invisible = new Circle($point[0], $point[1], 20); + $invisible->setFill($this->strokeColor); + $invisible->setAdditionalStyle('opacity: 0.0;'); $data = array( 'label' => isset($this->graphs[$this->order]['label']) ? strtolower($this->graphs[$this->order]['label']) : '', @@ -183,16 +182,12 @@ class LineGraph extends Styleable implements Drawable ); $format = isset($this->graphs[$this->order]['tooltip']) ? $this->graphs[$this->order]['tooltip'] : null; - $invisible->setAttribute( - 'title', - $this->tooltips[$x]->renderNoHtml($this->order, $data, $format) - ); - $invisible->setAttribute( - 'data-title-rich', - $this->tooltips[$x]->render($this->order, $data, $format) - ); + $title = $ctx->getDocument()->createElement('title'); + $title->textContent = $this->tooltips[$x]->renderNoHtml($this->order, $data, $format); + $invisibleRendered = $invisible->toSvg($ctx); + $invisibleRendered->appendChild($title); + $group->appendChild($invisibleRendered); } - $group->appendChild($invisible->toSvg($ctx)); } return $group; diff --git a/public/css/icinga/widgets.less b/public/css/icinga/widgets.less index 7ae5f2245..b8c478a24 100644 --- a/public/css/icinga/widgets.less +++ b/public/css/icinga/widgets.less @@ -316,11 +316,6 @@ ul.tree li a.error:hover { color: @color-critical; } -/* Add hover effect to chart data */ -.chart-data:hover { - opacity: 0.85; -} - /* charts should grow as much as possible but never beyond the current viewport's size */ .svg-container-responsive { padding: 1.5em;