filter过滤

(function () {
    appModule.controller('app.views.international.policy.flux.index', [
        '$scope', 'uiGridConstants', 'abp.services.app.sabreFlowStatistics','$filter',
        function($scope, uiGridConstants, sabreFlowStatisticsService, $filter) {
            var vm = this;
            vm.batchQueryParams = {};
            vm.options = {
                chart: {
                    type: 'discreteBarChart',
                    height: 350,
                    x: function(d) { return d.date; },
                    y: function(d) { return d.count; },
                    showValues: true,
                    valueFormat: function(d) { return d; },
                    yAxis: {
                        axisLabel: '流量数',
                        tickFormat: function(d) {
                            return d3.format(',f')(d);
                        }
                    }
                }
            };
            vm.data = [
                {
                    key: "FlowCount",
                    values: []
                }
            ];
            //航司流量统计饼状图
            vm.optionsCarrier = {
                chart: {
                    type: 'pieChart',
                    height: 350,
                    x: function(d) { return d.carrier; },
                    y: function(d) { return d.count; },
                    showLabels: true,
                    labelThreshold: 0.01,
                    labelSunbeamLayout: true,
                    duration: 500,
                    valueFormat: function(d) { return d; },
                    yAxis: {
                        axisLabel: '流量数',
                        tickFormat: function(d) {
                            return d3.format(',f')(d);
                        }
                    }
                }
            };
            vm.dataCarrier = [
                {
                    key: "FlowCount",
                    values: []
                }
            ];
            //航线流量统计柱状图
            vm.optionsAirline = {
                chart: {
                    type: 'discreteBarChart',
                    height: 350,
                    x: function (d) { return $filter('lineFilter')(d.airline,'-') },航线分隔:pek-sha
                    y: function(d) { return d.count; },
                    showValues: true,
                    valueFormat: function(d) { return d; },
                    yAxis: {
                        axisLabel: '流量数',
                        tickFormat: function(d) {
                            return d3.format(',f')(d);
                        }
                    },
                    dispatch: {
                        //tooltipShow: function (e) { console.log('! tooltip SHOW !') },
                        //tooltipHide: function (e) { console.log('! tooltip HIDE !') },
                        //beforeUpdate: function (e) { console.log('! before UPDATE !') }
                    
                    },
                    discretebar: {
                        dispatch: {
                            ////chartClick: function(e) {console.log("! chart Click !")},
                            //elementClick: function (e) { console.log("! element Click !") },
                            //elementDblClick: function (e) { console.log("! element Double Click !") },
                            //elementMouseout: function (e) { console.log("! element Mouseout !") },
                            //elementMouseover: function (e) { console.log("! element Mouseover !") }
                        
                        }
                    },
                    callback: function(e) {
                        //console.log('! callback !');
                    }
                }
            };

  

 

posted @ 2017-04-19 10:16  代码小白一枚  阅读(249)  评论(0编辑  收藏  举报