/***** * A no frills tooltip implementation. *****/(function(a){var b=window.nvtooltip={};b.show=function(b,c,d,e){var f=a('
"+c+" at "+b+"
"},f=a.models.lineWithLegend(),g=function(a){var c=$(b).offset(),d=a.pos[0]+c.left,g=a.pos[1]+c.top,h=f.xAxis.tickFormat(),i=f.yAxis.tickFormat(),j=h(f.x()(a.point)),k=i(f.y()(a.point)),l=e(a.series.key,j,k,a,f);nvtooltip.show([d,g],l)};f.xAxis.tickFormat(d3.format(",r")),f.yAxis.tickFormat(d3.format(",.2f")),h.build=function(){if(!b||!c.length)return h;a.addGraph({generate:function(){var a=d3.select(b),e=function(){return parseInt(a.style("width"))},g=function(){return parseInt(a.style("height"))},h=a.append("svg");f.width(e).height(g),h.attr("width",e()).attr("height",g()).datum(c).transition().duration(d).call(f);return f},callback:function(a){a.dispatch.on("tooltipShow",g),a.dispatch.on("tooltipHide",nvtooltip.cleanup),$(window).resize(function(){d3.select(b+" svg").attr("width",a.width()()).attr("height",a.height()()).call(a)})}});return h},h.data=function(a){if(!arguments.length)return c;c=a;return h},h.selector=function(a){if(!arguments.length)return b;b=a;return h},h.duration=function(a){if(!arguments.length)return d;d=a;return h},h.tooltip=function(a){if(!arguments.length)return e;e=a;return h},h.xTickFormat=function(a){if(!arguments.length)return f.xAxis.tickFormat();f.xAxis.tickFormat(typeof a=="function"?a:d3.format(a));return h},h.yTickFormat=function(a){if(!arguments.length)return f.yAxis.tickFormat();f.yAxis.tickFormat(typeof a=="function"?a:d3.format(a));return h},h.xAxisLabel=function(a){if(!arguments.length)return f.xAxis.axisLabel();f.xAxis.axisLabel(a);return h},h.yAxisLabel=function(a){if(!arguments.length)return f.yAxis.axisLabel();f.yAxis.axisLabel(a);return h},d3.rebind(h,f,"x","y"),h.graph=f;return h}}()