Skip to content

Commit

Permalink
Fixed bug that prevented x axis value from showing properly in some m…
Browse files Browse the repository at this point in the history
…ultiple-series implementations.
  • Loading branch information
Roundaround committed May 11, 2015
1 parent db8723c commit 214f1d2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/jquery.flot.tooltip.source.js
Original file line number Diff line number Diff line change
@@ -400,10 +400,12 @@
// see https://github.com/krzysu/flot.tooltip/issues/65
var tickIndex = item.dataIndex + item.seriesIndex;

if (item.series.xaxis[ticks].length > tickIndex && !this.isTimeMode('xaxis', item)) {
var valueX = (this.isCategoriesMode('xaxis', item)) ? item.series.xaxis[ticks][tickIndex].label : item.series.xaxis[ticks][tickIndex].v;
if (valueX === x) {
content = content.replace(xPattern, item.series.xaxis[ticks][tickIndex].label);
for (var index in item.series.xaxis[ticks]) {
if (item.series.xaxis[ticks].hasOwnProperty(tickIndex) && !this.isTimeMode('xaxis', item)) {
var valueX = (this.isCategoriesMode('xaxis', item)) ? item.series.xaxis[ticks][tickIndex].label : item.series.xaxis[ticks][tickIndex].v;
if (valueX === x) {
content = content.replace(xPattern, item.series.xaxis[ticks][tickIndex].label);
}
}
}
}

0 comments on commit 214f1d2

Please sign in to comment.