How to use the xlsxwriter.shape.Shape._get_line_properties 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
if 'line' in options['up']:
                up_line = Shape._get_line_properties(options['up']['line'])

            if 'fill' in options['up']:
                up_fill = Shape._get_fill_properties(options['up']['fill'])

        # Set properties for 'down' bar.
        if options.get('down'):
            if 'border' in options['down']:
                # Map border to line.
                down_line = \
                    Shape._get_line_properties(options['down']['border'])

            if 'line' in options['down']:
                down_line = Shape._get_line_properties(options['down']['line'])

            if 'fill' in options['down']:
                down_fill = Shape._get_fill_properties(options['down']['fill'])

        self.up_down_bars = {'up': {'line': up_line,
                                    'fill': up_fill,
                                    },
                             'down': {'line': down_line,
                                      'fill': down_fill,
                                      },
github jmcnamara / XlsxWriter / xlsxwriter / chart.py View on Github external
legend['position'] = options.get('position', 'right')
        legend['delete_series'] = options.get('delete_series')
        legend['font'] = self._convert_font_args(options.get('font'))
        legend['layout'] = self._get_layout_properties(options.get('layout'),
                                                       False)

        # Turn off the legend.
        if options.get('none'):
            legend['position'] = 'none'

        # Set the line properties for the legend.
        line = Shape._get_line_properties(options.get('line'))

        # Allow 'border' as a synonym for 'line'.
        if options.get('border'):
            line = Shape._get_line_properties(options['border'])

        # Set the fill properties for the legend.
        fill = Shape._get_fill_properties(options.get('fill'))

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

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

        # Pattern fill overrides solid fill.
        if pattern:
            self.fill = None

        # Gradient fill overrides the solid and pattern fill.
        if gradient:
github jmcnamara / XlsxWriter / xlsxwriter / chart.py View on Github external
options = {}

        # Defaults.
        up_line = None
        up_fill = None
        down_line = None
        down_fill = None

        # Set properties for 'up' bar.
        if options.get('up'):
            if 'border' in options['up']:
                # Map border to line.
                up_line = Shape._get_line_properties(options['up']['border'])

            if 'line' in options['up']:
                up_line = Shape._get_line_properties(options['up']['line'])

            if 'fill' in options['up']:
                up_fill = Shape._get_fill_properties(options['up']['fill'])

        # Set properties for 'down' bar.
        if options.get('down'):
            if 'border' in options['down']:
                # Map border to line.
                down_line = \
                    Shape._get_line_properties(options['down']['border'])

            if 'line' in options['down']:
                down_line = Shape._get_line_properties(options['down']['line'])

            if 'fill' in options['down']:
                down_fill = Shape._get_fill_properties(options['down']['fill'])
github jmcnamara / XlsxWriter / xlsxwriter / chart.py View on Github external
points = []

        if not user_points:
            return

        for user_point in user_points:
            point = {}

            if user_point is not None:

                # Set the line properties for the point.
                line = Shape._get_line_properties(user_point.get('line'))

                # Allow 'border' as a synonym for 'line'.
                if 'border' in user_point:
                    line = Shape._get_line_properties(user_point['border'])

                # Set the fill properties for the chartarea.
                fill = Shape._get_fill_properties(user_point.get('fill'))

                # Set the pattern fill properties for the series.
                pattern = \
                    Shape._get_pattern_properties(user_point.get('pattern'))

                # Set the gradient fill properties for the series.
                gradient = \
                    Shape._get_gradient_properties(user_point.get('gradient'))

                # Pattern fill overrides solid fill.
                if pattern:
                    self.fill = None
github jmcnamara / XlsxWriter / xlsxwriter / chart.py View on Github external
'picture': 'picture',
        }

        # Check for valid types.
        marker_type = marker.get('type')

        if marker_type is not None:

            if marker_type in types:
                marker['type'] = types[marker_type]
            else:
                warn("Unknown marker type '%s" % marker_type)
                return

        # Set the line properties for the marker.
        line = Shape._get_line_properties(marker.get('line'))

        # Allow 'border' as a synonym for 'line'.
        if 'border' in marker:
            line = Shape._get_line_properties(marker['border'])

        # Set the fill properties for the marker.
        fill = Shape._get_fill_properties(marker.get('fill'))

        # Set the pattern fill properties for the series.
        pattern = Shape._get_pattern_properties(marker.get('pattern'))

        # Set the gradient fill properties for the series.
        gradient = Shape._get_gradient_properties(marker.get('gradient'))

        # Pattern fill overrides solid fill.
        if pattern:
github jmcnamara / XlsxWriter / xlsxwriter / chart.py View on Github external
def _get_area_properties(self, options):
        # Convert user area properties to the structure required internally.
        area = {}

        # Set the line properties for the chartarea.
        line = Shape._get_line_properties(options.get('line'))

        # Allow 'border' as a synonym for 'line'.
        if options.get('border'):
            line = Shape._get_line_properties(options['border'])

        # Set the fill properties for the chartarea.
        fill = Shape._get_fill_properties(options.get('fill'))

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

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

        # Pattern fill overrides solid fill.
        if pattern:
github jmcnamara / XlsxWriter / xlsxwriter / chart.py View on Github external
def _get_area_properties(self, options):
        # Convert user area properties to the structure required internally.
        area = {}

        # Set the line properties for the chartarea.
        line = Shape._get_line_properties(options.get('line'))

        # Allow 'border' as a synonym for 'line'.
        if options.get('border'):
            line = Shape._get_line_properties(options['border'])

        # Set the fill properties for the chartarea.
        fill = Shape._get_fill_properties(options.get('fill'))

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

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

        # Pattern fill overrides solid fill.
        if pattern:
            self.fill = None

        # Gradient fill overrides the solid and pattern fill.
        if gradient:
github jmcnamara / XlsxWriter / xlsxwriter / chart.py View on Github external
if options is None:
            options = {}

        legend['position'] = options.get('position', 'right')
        legend['delete_series'] = options.get('delete_series')
        legend['font'] = self._convert_font_args(options.get('font'))
        legend['layout'] = self._get_layout_properties(options.get('layout'),
                                                       False)

        # Turn off the legend.
        if options.get('none'):
            legend['position'] = 'none'

        # Set the line properties for the legend.
        line = Shape._get_line_properties(options.get('line'))

        # Allow 'border' as a synonym for 'line'.
        if options.get('border'):
            line = Shape._get_line_properties(options['border'])

        # Set the fill properties for the legend.
        fill = Shape._get_fill_properties(options.get('fill'))

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

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

        # Pattern fill overrides solid fill.
        if pattern: