All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.assets.rjzjh.echarts.src.component.brush.brushAction.js Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
/**
 * @file Brush action
 */
define(function(require) {

    var echarts = require('../../echarts');

    /**
     * payload: {
     *      brushIndex: number, or,
     *      brushId: string, or,
     *      brushName: string,
     *      globalRanges: Array
     * }
     */
    echarts.registerAction(
         {type: 'brush', event: 'brush', update: 'updateView'},
        function (payload, ecModel) {
            ecModel.eachComponent({mainType: 'brush', query: payload}, function (brushModel) {
                brushModel.setBrushRanges(payload.brushRanges);
            });
        }
    );

    /**
     * payload: {
     *      brushIndex: number, or,
     *      brushId: string, or,
     *      brushName: string,
     *      brushOption: Object
     * }
     */
    echarts.registerAction(
         {type: 'enableBrush', event: 'brushEnabled', update: 'update'},
        function (payload, ecModel) {
            ecModel.eachComponent({mainType: 'brush', query: payload}, function (brushModel) {
                brushModel.setBrushOption(payload.brushOption);
            });
        }
    );
});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy