123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943 |
- (function($) {
-
- $.jqplot.FunnelRenderer = function(){
- $.jqplot.LineRenderer.call(this);
- };
-
- $.jqplot.FunnelRenderer.prototype = new $.jqplot.LineRenderer();
- $.jqplot.FunnelRenderer.prototype.constructor = $.jqplot.FunnelRenderer;
-
-
- $.jqplot.FunnelRenderer.prototype.init = function(options, plot) {
-
-
-
-
- this.padding = {top: 20, right: 20, bottom: 20, left: 20};
-
-
- this.sectionMargin = 6;
-
-
- this.fill = true;
-
-
-
- this.shadowOffset = 2;
-
-
- this.shadowAlpha = 0.07;
-
-
-
- this.shadowDepth = 5;
-
-
-
- this.highlightMouseOver = true;
-
-
-
- this.highlightMouseDown = false;
-
-
- this.highlightColors = [];
-
-
-
- this.widthRatio = 0.2;
-
-
- this.lineWidth = 2;
-
-
-
- this.dataLabels = 'percent';
-
-
- this.showDataLabels = false;
-
-
- this.dataLabelFormatString = null;
-
-
-
- this.dataLabelThreshold = 3;
- this._type = 'funnel';
-
- this.tickRenderer = $.jqplot.FunnelTickRenderer;
-
-
- if (options.highlightMouseDown && options.highlightMouseOver == null) {
- options.highlightMouseOver = false;
- }
-
- $.extend(true, this, options);
-
-
- this._highlightedPoint = null;
-
-
- this._bases = [];
-
- this._atot;
-
- this._areas = [];
-
- this._lengths = [];
-
- this._angle;
- this._dataIndices = [];
-
-
- this._unorderedData = $.extend(true, [], this.data);
- var idxs = $.extend(true, [], this.data);
- for (var i=0; i<idxs.length; i++) {
- idxs[i].push(i);
- }
- this.data.sort( function (a, b) { return b[1] - a[1]; } );
- idxs.sort( function (a, b) { return b[1] - a[1]; });
- for (var i=0; i<idxs.length; i++) {
- this._dataIndices.push(idxs[i][2]);
- }
-
-
- if (this.highlightColors.length == 0) {
- for (var i=0; i<this.seriesColors.length; i++){
- var rgba = $.jqplot.getColorComponents(this.seriesColors[i]);
- var newrgb = [rgba[0], rgba[1], rgba[2]];
- var sum = newrgb[0] + newrgb[1] + newrgb[2];
- for (var j=0; j<3; j++) {
-
- newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.4 * (255 - newrgb[j]);
- newrgb[j] = parseInt(newrgb[j], 10);
- }
- this.highlightColors.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')');
- }
- }
- plot.postParseOptionsHooks.addOnce(postParseOptions);
- plot.postInitHooks.addOnce(postInit);
- plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
- plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
- plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
- plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
- plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
- plot.postDrawHooks.addOnce(postPlotDraw);
-
- };
-
-
- $.jqplot.FunnelRenderer.prototype.setGridData = function(plot) {
-
- var sum = 0;
- var td = [];
- for (var i=0; i<this.data.length; i++){
- sum += this.data[i][1];
- td.push([this.data[i][0], this.data[i][1]]);
- }
-
-
- for (var i=0; i<td.length; i++) {
- td[i][1] = td[i][1]/sum;
- }
-
- this._bases = new Array(td.length + 1);
- this._lengths = new Array(td.length);
-
- this.gridData = td;
- };
-
- $.jqplot.FunnelRenderer.prototype.makeGridData = function(data, plot) {
-
- var sum = 0;
- var td = [];
- for (var i=0; i<this.data.length; i++){
- sum += this.data[i][1];
- td.push([this.data[i][0], this.data[i][1]]);
- }
-
-
- for (var i=0; i<td.length; i++) {
- td[i][1] = td[i][1]/sum;
- }
-
- this._bases = new Array(td.length + 1);
- this._lengths = new Array(td.length);
-
- return td;
- };
-
- $.jqplot.FunnelRenderer.prototype.drawSection = function (ctx, vertices, color, isShadow) {
- var fill = this.fill;
- var lineWidth = this.lineWidth;
- ctx.save();
-
- if (isShadow) {
- for (var i=0; i<this.shadowDepth; i++) {
- ctx.save();
- ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
- doDraw();
- }
- }
-
- else {
- doDraw();
- }
-
- function doDraw () {
- ctx.beginPath();
- ctx.fillStyle = color;
- ctx.strokeStyle = color;
- ctx.lineWidth = lineWidth;
- ctx.moveTo(vertices[0][0], vertices[0][1]);
- for (var i=1; i<4; i++) {
- ctx.lineTo(vertices[i][0], vertices[i][1]);
- }
- ctx.closePath();
- if (fill) {
- ctx.fill();
- }
- else {
- ctx.stroke();
- }
- }
-
- if (isShadow) {
- for (var i=0; i<this.shadowDepth; i++) {
- ctx.restore();
- }
- }
-
- ctx.restore();
- };
-
-
- $.jqplot.FunnelRenderer.prototype.draw = function (ctx, gd, options, plot) {
- var i;
- var opts = (options != undefined) ? options : {};
-
- var offx = 0;
- var offy = 0;
- var trans = 1;
- this._areas = [];
-
- if (options.legendInfo && options.legendInfo.placement == 'insideGrid') {
- var li = options.legendInfo;
- switch (li.location) {
- case 'nw':
- offx = li.width + li.xoffset;
- break;
- case 'w':
- offx = li.width + li.xoffset;
- break;
- case 'sw':
- offx = li.width + li.xoffset;
- break;
- case 'ne':
- offx = li.width + li.xoffset;
- trans = -1;
- break;
- case 'e':
- offx = li.width + li.xoffset;
- trans = -1;
- break;
- case 'se':
- offx = li.width + li.xoffset;
- trans = -1;
- break;
- case 'n':
- offy = li.height + li.yoffset;
- break;
- case 's':
- offy = li.height + li.yoffset;
- trans = -1;
- break;
- default:
- break;
- }
- }
-
- var loff = (trans==1) ? this.padding.left + offx : this.padding.left;
- var toff = (trans==1) ? this.padding.top + offy : this.padding.top;
- var roff = (trans==-1) ? this.padding.right + offx : this.padding.right;
- var boff = (trans==-1) ? this.padding.bottom + offy : this.padding.bottom;
-
- var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
- var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
- var fill = (opts.fill != undefined) ? opts.fill : this.fill;
- var cw = ctx.canvas.width;
- var ch = ctx.canvas.height;
- this._bases[0] = cw - loff - roff;
- var ltot = this._length = ch - toff - boff;
- var hend = this._bases[0]*this.widthRatio;
- this._atot = ltot/2 * (this._bases[0] + this._bases[0]*this.widthRatio);
- this._angle = Math.atan((this._bases[0] - hend)/2/ltot);
- for (i=0; i<gd.length; i++) {
- this._areas.push(gd[i][1] * this._atot);
- }
-
- var guess, err, count, lsum=0;
- var tolerance = 0.0001;
- for (i=0; i<this._areas.length; i++) {
- guess = this._areas[i]/this._bases[i];
- err = 999999;
- this._lengths[i] = guess;
- count = 0;
- while (err > this._lengths[i]*tolerance && count < 100) {
- this._lengths[i] = this._areas[i]/(this._bases[i] - this._lengths[i] * Math.tan(this._angle));
- err = Math.abs(this._lengths[i] - guess);
- this._bases[i+1] = this._bases[i] - (2*this._lengths[i]*Math.tan(this._angle));
- guess = this._lengths[i];
- count++;
- }
- lsum += this._lengths[i];
- }
-
-
- this._vertices = new Array(gd.length);
-
-
- var p0 = [loff, toff],
- p1 = [loff+this._bases[0], toff],
- p2 = [loff + (this._bases[0] - this._bases[this._bases.length-1])/2, toff + this._length],
- p3 = [p2[0] + this._bases[this._bases.length-1], p2[1]];
-
-
- function findleft (l) {
- var m = (p0[1] - p2[1])/(p0[0] - p2[0]);
- var b = p0[1] - m*p0[0];
- var y = l + p0[1];
-
- return [(y - b)/m, y];
- }
-
- function findright (l) {
- var m = (p1[1] - p3[1])/(p1[0] - p3[0]);
- var b = p1[1] - m*p1[0];
- var y = l + p1[1];
-
- return [(y - b)/m, y];
- }
-
- var x = offx, y = offy;
- var h=0, adj=0;
-
- for (i=0; i<gd.length; i++) {
- this._vertices[i] = new Array();
- var v = this._vertices[i];
- var sm = this.sectionMargin;
- if (i == 0) {
- adj = 0;
- }
- if (i == 1) {
- adj = sm/3;
- }
- else if (i > 0 && i < gd.length-1) {
- adj = sm/2;
- }
- else if (i == gd.length -1) {
- adj = 2*sm/3;
- }
- v.push(findleft(h+adj));
- v.push(findright(h+adj));
- h += this._lengths[i];
- if (i == 0) {
- adj = -2*sm/3;
- }
- else if (i > 0 && i < gd.length-1) {
- adj = -sm/2;
- }
- else if (i == gd.length - 1) {
- adj = 0;
- }
- v.push(findright(h+adj));
- v.push(findleft(h+adj));
-
- }
- if (this.shadow) {
- var shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')';
- for (var i=0; i<gd.length; i++) {
- this.renderer.drawSection.call (this, ctx, this._vertices[i], shadowColor, true);
- }
-
- }
- for (var i=0; i<gd.length; i++) {
- var v = this._vertices[i];
- this.renderer.drawSection.call (this, ctx, v, this.seriesColors[i]);
-
- if (this.showDataLabels && gd[i][1]*100 >= this.dataLabelThreshold) {
- var fstr, label;
-
- if (this.dataLabels == 'label') {
- fstr = this.dataLabelFormatString || '%s';
- label = $.jqplot.sprintf(fstr, gd[i][0]);
- }
- else if (this.dataLabels == 'value') {
- fstr = this.dataLabelFormatString || '%d';
- label = $.jqplot.sprintf(fstr, this.data[i][1]);
- }
- else if (this.dataLabels == 'percent') {
- fstr = this.dataLabelFormatString || '%d%%';
- label = $.jqplot.sprintf(fstr, gd[i][1]*100);
- }
- else if (this.dataLabels.constructor == Array) {
- fstr = this.dataLabelFormatString || '%s';
- label = $.jqplot.sprintf(fstr, this.dataLabels[this._dataIndices[i]]);
- }
-
- var fact = (this._radius ) * this.dataLabelPositionFactor + this.sliceMargin + this.dataLabelNudge;
-
- var x = (v[0][0] + v[1][0])/2 + this.canvas._offsets.left;
- var y = (v[1][1] + v[2][1])/2 + this.canvas._offsets.top;
-
- var labelelem = $('<span class="jqplot-funnel-series jqplot-data-label" style="position:absolute;">' + label + '</span>').insertBefore(plot.eventCanvas._elem);
- x -= labelelem.width()/2;
- y -= labelelem.height()/2;
- x = Math.round(x);
- y = Math.round(y);
- labelelem.css({left: x, top: y});
- }
-
- }
-
- };
-
- $.jqplot.FunnelAxisRenderer = function() {
- $.jqplot.LinearAxisRenderer.call(this);
- };
-
- $.jqplot.FunnelAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
- $.jqplot.FunnelAxisRenderer.prototype.constructor = $.jqplot.FunnelAxisRenderer;
-
-
-
-
-
- $.jqplot.FunnelAxisRenderer.prototype.init = function(options){
-
- this.tickRenderer = $.jqplot.FunnelTickRenderer;
- $.extend(true, this, options);
-
-
-
-
-
- this._dataBounds = {min:0, max:100};
- this.min = 0;
- this.max = 100;
- this.showTicks = false;
- this.ticks = [];
- this.showMark = false;
- this.show = false;
- };
-
-
-
-
- $.jqplot.FunnelLegendRenderer = function(){
- $.jqplot.TableLegendRenderer.call(this);
- };
-
- $.jqplot.FunnelLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
- $.jqplot.FunnelLegendRenderer.prototype.constructor = $.jqplot.FunnelLegendRenderer;
-
- $.jqplot.FunnelLegendRenderer.prototype.init = function(options) {
-
-
-
-
- this.numberRows = null;
-
-
- this.numberColumns = null;
- $.extend(true, this, options);
- };
-
-
- $.jqplot.FunnelLegendRenderer.prototype.draw = function() {
- var legend = this;
- if (this.show) {
- var series = this._series;
- var ss = 'position:absolute;';
- ss += (this.background) ? 'background:'+this.background+';' : '';
- ss += (this.border) ? 'border:'+this.border+';' : '';
- ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
- ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
- ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
- ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : '';
- ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : '';
- ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : '';
- ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : '';
- this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
-
-
-
- var pad = false,
- reverse = false,
- nr, nc;
- var s = series[0];
- var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors);
-
- if (s.show) {
- var pd = s.data;
- if (this.numberRows) {
- nr = this.numberRows;
- if (!this.numberColumns){
- nc = Math.ceil(pd.length/nr);
- }
- else{
- nc = this.numberColumns;
- }
- }
- else if (this.numberColumns) {
- nc = this.numberColumns;
- nr = Math.ceil(pd.length/this.numberColumns);
- }
- else {
- nr = pd.length;
- nc = 1;
- }
-
- var i, j, tr, td1, td2, lt, rs, color;
- var idx = 0;
-
- for (i=0; i<nr; i++) {
- if (reverse){
- tr = $('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem);
- }
- else{
- tr = $('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem);
- }
- for (j=0; j<nc; j++) {
- if (idx < pd.length){
- lt = this.labels[idx] || pd[idx][0].toString();
- color = colorGenerator.next();
- if (!reverse){
- if (i>0){
- pad = true;
- }
- else{
- pad = false;
- }
- }
- else{
- if (i == nr -1){
- pad = false;
- }
- else{
- pad = true;
- }
- }
- rs = (pad) ? this.rowSpacing : '0';
-
- td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
- '<div><div class="jqplot-table-legend-swatch" style="border-color:'+color+';"></div>'+
- '</div></td>');
- td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
- if (this.escapeHtml){
- td2.text(lt);
- }
- else {
- td2.html(lt);
- }
- if (reverse) {
- td2.prependTo(tr);
- td1.prependTo(tr);
- }
- else {
- td1.appendTo(tr);
- td2.appendTo(tr);
- }
- pad = true;
- }
- idx++;
- }
- }
- }
- }
- return this._elem;
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- function preInit(target, data, options) {
- options = options || {};
- options.axesDefaults = options.axesDefaults || {};
- options.legend = options.legend || {};
- options.seriesDefaults = options.seriesDefaults || {};
-
- var setopts = false;
- if (options.seriesDefaults.renderer == $.jqplot.FunnelRenderer) {
- setopts = true;
- }
- else if (options.series) {
- for (var i=0; i < options.series.length; i++) {
- if (options.series[i].renderer == $.jqplot.FunnelRenderer) {
- setopts = true;
- }
- }
- }
-
- if (setopts) {
- options.axesDefaults.renderer = $.jqplot.FunnelAxisRenderer;
- options.legend.renderer = $.jqplot.FunnelLegendRenderer;
- options.legend.preDraw = true;
- options.sortData = false;
- options.seriesDefaults.pointLabels = {show: false};
- }
- }
-
- function postInit(target, data, options) {
-
-
- for (var i=0; i<this.series.length; i++) {
- if (this.series[i].renderer.constructor == $.jqplot.FunnelRenderer) {
-
- if (this.series[i].highlightMouseOver) {
- this.series[i].highlightMouseDown = false;
- }
- }
- }
- }
-
-
- function postParseOptions(options) {
- for (var i=0; i<this.series.length; i++) {
- this.series[i].seriesColors = this.seriesColors;
- this.series[i].colorGenerator = $.jqplot.colorGenerator;
- }
- }
-
- function highlight (plot, sidx, pidx) {
- var s = plot.series[sidx];
- var canvas = plot.plugins.funnelRenderer.highlightCanvas;
- canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
- s._highlightedPoint = pidx;
- plot.plugins.funnelRenderer.highlightedSeriesIndex = sidx;
- s.renderer.drawSection.call(s, canvas._ctx, s._vertices[pidx], s.highlightColors[pidx], false);
- }
-
- function unhighlight (plot) {
- var canvas = plot.plugins.funnelRenderer.highlightCanvas;
- canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
- for (var i=0; i<plot.series.length; i++) {
- plot.series[i]._highlightedPoint = null;
- }
- plot.plugins.funnelRenderer.highlightedSeriesIndex = null;
- plot.target.trigger('jqplotDataUnhighlight');
- }
-
- function handleMove(ev, gridpos, datapos, neighbor, plot) {
- if (neighbor) {
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
- var evt1 = jQuery.Event('jqplotDataMouseOver');
- evt1.pageX = ev.pageX;
- evt1.pageY = ev.pageY;
- plot.target.trigger(evt1, ins);
- if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.funnelRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
- var evt = jQuery.Event('jqplotDataHighlight');
- evt.which = ev.which;
- evt.pageX = ev.pageX;
- evt.pageY = ev.pageY;
- plot.target.trigger(evt, ins);
- highlight (plot, ins[0], ins[1]);
- }
- }
- else if (neighbor == null) {
- unhighlight (plot);
- }
- }
-
- function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
- if (neighbor) {
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
- if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.funnelRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
- var evt = jQuery.Event('jqplotDataHighlight');
- evt.which = ev.which;
- evt.pageX = ev.pageX;
- evt.pageY = ev.pageY;
- plot.target.trigger(evt, ins);
- highlight (plot, ins[0], ins[1]);
- }
- }
- else if (neighbor == null) {
- unhighlight (plot);
- }
- }
-
- function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
- var idx = plot.plugins.funnelRenderer.highlightedSeriesIndex;
- if (idx != null && plot.series[idx].highlightMouseDown) {
- unhighlight(plot);
- }
- }
-
- function handleClick(ev, gridpos, datapos, neighbor, plot) {
- if (neighbor) {
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
- var evt = jQuery.Event('jqplotDataClick');
- evt.which = ev.which;
- evt.pageX = ev.pageX;
- evt.pageY = ev.pageY;
- plot.target.trigger(evt, ins);
- }
- }
-
- function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
- if (neighbor) {
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
- var idx = plot.plugins.funnelRenderer.highlightedSeriesIndex;
- if (idx != null && plot.series[idx].highlightMouseDown) {
- unhighlight(plot);
- }
- var evt = jQuery.Event('jqplotDataRightClick');
- evt.which = ev.which;
- evt.pageX = ev.pageX;
- evt.pageY = ev.pageY;
- plot.target.trigger(evt, ins);
- }
- }
-
-
-
-
- function postPlotDraw() {
-
- if (this.plugins.funnelRenderer && this.plugins.funnelRenderer.highlightCanvas) {
- this.plugins.funnelRenderer.highlightCanvas.resetCanvas();
- this.plugins.funnelRenderer.highlightCanvas = null;
- }
- this.plugins.funnelRenderer = {};
- this.plugins.funnelRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
-
-
- var labels = $(this.targetId+' .jqplot-data-label');
- if (labels.length) {
- $(labels[0]).before(this.plugins.funnelRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-funnelRenderer-highlight-canvas', this._plotDimensions, this));
- }
-
- else {
- this.eventCanvas._elem.before(this.plugins.funnelRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-funnelRenderer-highlight-canvas', this._plotDimensions, this));
- }
- var hctx = this.plugins.funnelRenderer.highlightCanvas.setContext();
- this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
- }
-
- $.jqplot.preInitHooks.push(preInit);
-
- $.jqplot.FunnelTickRenderer = function() {
- $.jqplot.AxisTickRenderer.call(this);
- };
-
- $.jqplot.FunnelTickRenderer.prototype = new $.jqplot.AxisTickRenderer();
- $.jqplot.FunnelTickRenderer.prototype.constructor = $.jqplot.FunnelTickRenderer;
-
- })(jQuery);
-
-
|