How to use the xlsxwriter.shape.Shape function in XlsxWriter

To help you get started, we’ve selected a few XlsxWriter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jmcnamara / XlsxWriter / xlsxwriter / chart.py View on Github external
def _get_gridline_properties(self, options):
        # Convert user gridline properties to structure required internally.

        # Set the visible property for the gridline.
        gridline = {'visible': options.get('visible')}

        # Set the line properties for the gridline.
        gridline['line'] = Shape._get_line_properties(options.get('line'))

        return gridline
github jmcnamara / XlsxWriter / xlsxwriter / chart.py View on Github external
self.date_1904,
                                                          self.remove_timezone)

        # Set the font properties if present.
        axis['num_font'] = self._convert_font_args(options.get('num_font'))
        axis['name_font'] = self._convert_font_args(options.get('name_font'))

        # Set the axis name layout.
        axis['name_layout'] = \
            self._get_layout_properties(options.get('name_layout'), True)

        # Set the line properties for the axis.
        axis['line'] = Shape._get_line_properties(options.get('line'))

        # Set the fill properties for the axis.
        axis['fill'] = Shape._get_fill_properties(options.get('fill'))

        # Set the pattern fill properties for the series.
        axis['pattern'] = Shape._get_pattern_properties(options.get('pattern'))

        # Set the gradient fill properties for the series.
        axis['gradient'] = \
            Shape._get_gradient_properties(options.get('gradient'))

        # Pattern fill overrides solid fill.
        if axis.get('pattern'):
            axis['fill'] = None

        # Gradient fill overrides the solid and pattern fill.
        if axis.get('gradient'):
            axis['pattern'] = None
            axis['fill'] = None
github jmcnamara / XlsxWriter / xlsxwriter / chart.py View on Github external
# Set the axis name layout.
        axis['name_layout'] = \
            self._get_layout_properties(options.get('name_layout'), True)

        # Set the line properties for the axis.
        axis['line'] = Shape._get_line_properties(options.get('line'))

        # Set the fill properties for the axis.
        axis['fill'] = Shape._get_fill_properties(options.get('fill'))

        # Set the pattern fill properties for the series.
        axis['pattern'] = Shape._get_pattern_properties(options.get('pattern'))

        # Set the gradient fill properties for the series.
        axis['gradient'] = \
            Shape._get_gradient_properties(options.get('gradient'))

        # Pattern fill overrides solid fill.
        if axis.get('pattern'):
            axis['fill'] = None

        # Gradient fill overrides the solid and pattern fill.
        if axis.get('gradient'):
            axis['pattern'] = None
            axis['fill'] = None

        # Set the tick marker types.
        axis['minor_tick_mark'] = \
            self._get_tick_type(options.get('minor_tick_mark'))
        axis['major_tick_mark'] = \
            self._get_tick_type(options.get('major_tick_mark'))
github jmcnamara / XlsxWriter / xlsxwriter / chart.py View on Github external
# Set the font properties if present.
        axis['num_font'] = self._convert_font_args(options.get('num_font'))
        axis['name_font'] = self._convert_font_args(options.get('name_font'))

        # Set the axis name layout.
        axis['name_layout'] = \
            self._get_layout_properties(options.get('name_layout'), True)

        # Set the line properties for the axis.
        axis['line'] = Shape._get_line_properties(options.get('line'))

        # Set the fill properties for the axis.
        axis['fill'] = Shape._get_fill_properties(options.get('fill'))

        # Set the pattern fill properties for the series.
        axis['pattern'] = Shape._get_pattern_properties(options.get('pattern'))

        # Set the gradient fill properties for the series.
        axis['gradient'] = \
            Shape._get_gradient_properties(options.get('gradient'))

        # Pattern fill overrides solid fill.
        if axis.get('pattern'):
            axis['fill'] = None

        # Gradient fill overrides the solid and pattern fill.
        if axis.get('gradient'):
            axis['pattern'] = None
            axis['fill'] = None

        # Set the tick marker types.
        axis['minor_tick_mark'] = \
github jmcnamara / XlsxWriter / xlsxwriter / shape.py View on Github external
def __init__(self, shape_type, name, options):
        """
        Constructor.

        """
        super(Shape, self).__init__()
        self.name = name
        self.shape_type = shape_type
        self.connect = 0
        self.drawing = 0
        self.edit_as = ''
        self.id = 0
        self.text = ''
        self.textlink = ''
        self.stencil = 1
        self.element = -1
        self.start = None
        self.start_index = None
        self.end = None
        self.end_index = None
        self.adjustments = []
        self.start_side = ''