airflow/_vendor/nvd3/NVD3Chart.py
def create_x_axis(self, name, label=None, format=None, date=False, custom_format=False):
        """Create X-axis"""
        axis = {}
        if custom_format and format:
            axis['tickFormat'] = format
        elif format:
            if format == 'AM_PM':
                axis['tickFormat'] = "function(d) { return get_am_pm(parseInt(d)); }"
            else:
                axis['tickFormat'] = "d3.format(',%s')" % format

        if label:
            axis['axisLabel'] = "'" + label + "'"

        # date format : see https://github.com/mbostock/d3/wiki/Time-Formatting
        if date:
            self.dateformat = format
            axis['tickFormat'] = ("function(d) { return d3.time.format('%s')"
                                  "(new Date(parseInt(d))) }\n"
                                  "" % self.dateformat)
            # flag is the x Axis is a date
            if name[0] == 'x':
                self.x_axis_date = True

        # Add new axis to list of axis
        self.axislist[name] = axis

        # Create x2Axis if focus_enable
        if name == "xAxis" and self.focus_enable:
            self.axislist['x2Axis'] = axis
def create_x_axis(self, name, label=None, format=None, date=False, custom_format=False):
        axis = {}
        if custom_format and format:
            axis['tickFormat'] = format
        elif format:
            if format == 'AM_PM':
                axis['tickFormat'] = "function(d) { return get_am_pm(parseInt(d)); }"
            else:
                axis['tickFormat'] = "d3.format(',%s')" % format

        if label:
            axis['axisLabel'] = "'" + label + "'"

        # date format : see https://github.com/mbostock/d3/wiki/Time-Formatting
        if date:
            self.dateformat = format
            axis['tickFormat'] = ("function(d) { return d3.time.format('%s')"
                                  "(new Date(parseInt(d))) }\n"
                                  "" % self.dateformat)
            # flag is the x Axis is a date
            if name[0] == 'x':
                self.x_axis_date = True

        # Add new axis to list of axis
        self.axislist[name] = axis

        # Create x2Axis if focus_enable
        if name == "xAxis" and self.focus_enable:
            self.axislist['x2Axis'] = axis
def create_x_axis ( self , name , label = None , format = None , date = False , custom_format = False ) : axis = { } if custom_format and format : axis [ 'tickFormat' ] = format elif format : if format == 'AM_PM' : axis [ 'tickFormat' ] = "function(d) { return get_am_pm(parseInt(d)); }" else : axis [ 'tickFormat' ] = "d3.format(',%s')" % format if label : axis [ 'axisLabel' ] = "'" + label + "'" # date format : see https://github.com/mbostock/d3/wiki/Time-Formatting if date : self . dateformat = format axis [ 'tickFormat' ] = ( "function(d) { return d3.time.format('%s')" "(new Date(parseInt(d))) }\n" "" % self . dateformat ) # flag is the x Axis is a date if name [ 0 ] == 'x' : self . x_axis_date = True # Add new axis to list of axis self . axislist [ name ] = axis # Create x2Axis if focus_enable if name == "xAxis" and self . focus_enable : self . axislist [ 'x2Axis' ] = axis
Create X-axis
Create X - axis