src/core/core.plugins.js
function(chart) {
		var cache = chart.$plugins || (chart.$plugins = {});
		if (cache.id === this._cacheId) {
			return cache.descriptors;
		}

		var plugins = [];
		var descriptors = [];
		var config = (chart && chart.config) || {};
		var options = (config.options && config.options.plugins) || {};

		this._plugins.concat(config.plugins || []).forEach(function(plugin) {
			var idx = plugins.indexOf(plugin);
			if (idx !== -1) {
				return;
			}

			var id = plugin.id;
			var opts = options[id];
			if (opts === false) {
				return;
			}

			if (opts === true) {
				opts = helpers.clone(defaults.global.plugins[id]);
			}

			plugins.push(plugin);
			descriptors.push({
				plugin: plugin,
				options: opts || {}
			});
		});

		cache.descriptors = descriptors;
		cache.id = this._cacheId;
		return descriptors;
	}
function(chart) {
		var cache = chart.$plugins || (chart.$plugins = {});
		if (cache.id === this._cacheId) {
			return cache.descriptors;
		}

		var plugins = [];
		var descriptors = [];
		var config = (chart && chart.config) || {};
		var options = (config.options && config.options.plugins) || {};

		this._plugins.concat(config.plugins || []).forEach(function(plugin) {
			var idx = plugins.indexOf(plugin);
			if (idx !== -1) {
				return;
			}

			var id = plugin.id;
			var opts = options[id];
			if (opts === false) {
				return;
			}

			if (opts === true) {
				opts = helpers.clone(defaults.global.plugins[id]);
			}

			plugins.push(plugin);
			descriptors.push({
				plugin: plugin,
				options: opts || {}
			});
		});

		cache.descriptors = descriptors;
		cache.id = this._cacheId;
		return descriptors;
	}
function ( chart ) { var cache = chart . $plugins || ( chart . $plugins = { } ) ; if ( cache . id === this . _cacheId ) { return cache . descriptors ; } var plugins = [ ] ; var descriptors = [ ] ; var config = ( chart && chart . config ) || { } ; var options = ( config . options && config . options . plugins ) || { } ; this . _plugins . concat ( config . plugins || [ ] ) . forEach ( function ( plugin ) { var idx = plugins . indexOf ( plugin ) ; if ( idx !== - 1 ) { return ; } var id = plugin . id ; var opts = options [ id ] ; if ( opts === false ) { return ; } if ( opts === true ) { opts = helpers . clone ( defaults . global . plugins [ id ] ) ; } plugins . push ( plugin ) ; descriptors . push ( { plugin : plugin , options : opts || { } } ) ; } ) ; cache . descriptors = descriptors ; cache . id = this . _cacheId ; return descriptors ; }
Returns descriptors of enabled plugins for the given chart.
@returns {object[]} [{ plugin, options }]
@private
Returns descriptors of enabled plugins for the given chart .