Skip to content

Commit

Permalink
Refs matomo-org#4077, matomo-org#4041, separated jqplot specific code…
Browse files Browse the repository at this point in the history
… from generic series picker code and cleaned up series picker code a bit.
  • Loading branch information
Benaka Moorthi committed Aug 26, 2013
1 parent caef9f9 commit fcb5892
Show file tree
Hide file tree
Showing 2 changed files with 160 additions and 118 deletions.
8 changes: 7 additions & 1 deletion plugins/CoreVisualizations/javascripts/jqplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -1042,17 +1042,23 @@ RowEvolutionSeriesToggle.prototype.beforeReplot = function () {
var dataTable = $('#' + target).closest('.dataTable').data('dataTableInstance');
var seriesPicker = new piwik.SeriesPicker(dataTable);

// handle placeSeriesPicker event
var plot = this;
$(seriesPicker).bind('placeSeriesPicker', function () {
this.domElem.css('margin-left', (plot._gridPadding.left + plot.plugins.canvasLegend.width - 1) + 'px');
plot.baseCanvas._elem.before(this.domElem);
})

// handle seriesPicked event
$(seriesPicker).bind('seriesPicked', function (e, columns, rows) {
$('#' + this.dataTableId + ' .piwik-graph').trigger('changeSeries', [columns, rows]);
});

this.plugins.seriesPicker = seriesPicker;
});

$.jqplot.postDrawHooks.push(function () {
this.plugins.seriesPicker.createElement(this);
this.plugins.seriesPicker.createElement();
});
})(jQuery);

Expand Down
Loading

0 comments on commit fcb5892

Please sign in to comment.