Skip to content

Commit 7054f73

Browse files
committed
Fixed jasmine specs and ct:meta issue (#33)
1 parent 10e4d6b commit 7054f73

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

dist/chartist-plugin-tooltip.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@
8484
var $point = event.target;
8585
var tooltipText = '';
8686

87-
var meta = $point.getAttribute('ct:meta') || '';
87+
var seriesName = ($point.parentNode) ? $point.parentNode.getAttribute('ct:series-name') : '';
88+
var meta = $point.getAttribute('ct:meta') || seriesName || '';
89+
var hasMeta = !!meta;
8890
var value = $point.getAttribute('ct:value');
8991

9092
if (options.tooltipFnc) {
@@ -94,7 +96,7 @@
9496
meta = '<span class="chartist-tooltip-meta">' + meta + '</span>';
9597
value = '<span class="chartist-tooltip-value">' + value + '</span>';
9698

97-
if (meta) {
99+
if (hasMeta) {
98100
tooltipText += meta + '<br>';
99101
} else {
100102
// For Pie Charts also take the labels into account

dist/chartist-plugin-tooltip.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)