X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=plugins%2Flegend.js;h=b54770f3619bb83795cd557b0f111ea4aa1b6440;hb=daab85060912edf8b14c7315a40b3cbe9e923c07;hp=5c46aee7ed22def3928b37d64367763b67f9f138;hpb=92588fa1956f9e9e71e53e170a57048efed35c87;p=dygraphs.git diff --git a/plugins/legend.js b/plugins/legend.js index 5c46aee..b54770f 100644 --- a/plugins/legend.js +++ b/plugins/legend.js @@ -254,7 +254,7 @@ legend.generateLegendHTML = function(g, x, sel_points, oneEmWidth, row) { // TODO(danvk): remove this use of a private API var xOptView = g.optionsViewForAxis_('x'); var xvf = xOptView('valueFormatter'); - html = xvf(x, xOptView, labels[0], g, row, 0); + html = xvf.call(g, x, xOptView, labels[0], g, row, 0); if (html !== '') { html += ':'; } @@ -277,7 +277,7 @@ legend.generateLegendHTML = function(g, x, sel_points, oneEmWidth, row) { var series = g.getPropertiesForSeries(pt.name); var yOptView = yOptViews[series.axis - 1]; var fmtFunc = yOptView('valueFormatter'); - var yval = fmtFunc(pt.yval, yOptView, pt.name, g, row, labels.indexOf(pt.name)); + var yval = fmtFunc.call(g, pt.yval, yOptView, pt.name, g, row, labels.indexOf(pt.name)); var cls = (pt.name == highlightSeries) ? " class='highlight'" : "";