Commit f294bf19 authored by David Schnur's avatar David Schnur

Cleaned up processOptions and bindEvents hooks.

parent aaf41ea4
...@@ -81,16 +81,9 @@ More detail and specific examples can be found in the included HTML file. ...@@ -81,16 +81,9 @@ More detail and specific examples can be found in the included HTML file.
// add hook to determine if pie plugin in enabled, and then perform necessary operations // add hook to determine if pie plugin in enabled, and then perform necessary operations
plot.hooks.processOptions.push(checkPieEnabled); plot.hooks.processOptions.push(function(plot, options) {
plot.hooks.bindEvents.push(bindEvents);
// check to see if the pie plugin is enabled
function checkPieEnabled(plot, options) {
if (options.series.pie.show) { if (options.series.pie.show) {
//disable grid
options.grid.show = false; options.grid.show = false;
// set labels.show // set labels.show
...@@ -130,11 +123,11 @@ More detail and specific examples can be found in the included HTML file. ...@@ -130,11 +123,11 @@ More detail and specific examples can be found in the included HTML file.
plot.hooks.draw.push(draw); plot.hooks.draw.push(draw);
} }
} });
// bind hoverable events // bind hoverable events
function bindEvents(plot, eventHolder) { plot.hooks.bindEvents.push(function(plot, eventHolder) {
var options = plot.getOptions(); var options = plot.getOptions();
if (options.series.pie.show) { if (options.series.pie.show) {
if (options.grid.hoverable) { if (options.grid.hoverable) {
...@@ -144,7 +137,7 @@ More detail and specific examples can be found in the included HTML file. ...@@ -144,7 +137,7 @@ More detail and specific examples can be found in the included HTML file.
eventHolder.unbind("click").click(onClick); eventHolder.unbind("click").click(onClick);
} }
} }
} });
// debugging function that prints out an object // debugging function that prints out an object
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment