diff --git a/dev/docs/source/working_with_charts.rst b/dev/docs/source/working_with_charts.rst index 334095c2..a43329e7 100644 --- a/dev/docs/source/working_with_charts.rst +++ b/dev/docs/source/working_with_charts.rst @@ -1501,8 +1501,8 @@ See :ref:`ex_chart_date_axis`. Chart Secondary Axes -------------------- -It is possible to add a secondary axis of the same type to a chart by setting -the ``y2_axis`` or ``x2_axis`` property of the series:: + It is possible to add a secondary axis of the same type to a chart by setting + the ``y2_axis`` or ``x2_axis`` property of the series:: import xlsxwriter @@ -1638,7 +1638,7 @@ There are some limitations on combined charts: * Pie charts cannot currently be combined. * Scatter charts cannot currently be used as a primary chart but they can be used as a secondary chart. -* Bar charts can only combined secondary charts on a secondary axis. This is +* Bar charts can only combine secondary charts on a secondary axis. This is an Excel limitation. diff --git a/examples/chart_combined.py b/examples/chart_combined.py index a403fb13..d05cad9b 100644 --- a/examples/chart_combined.py +++ b/examples/chart_combined.py @@ -43,7 +43,7 @@ } ) -# Create a new column chart. This will use this as the secondary chart. +# Create a new line chart. This will use this as the secondary chart. line_chart1 = workbook.add_chart({"type": "line"}) # Configure the data series for the secondary chart. diff --git a/xlsxwriter/chart.py b/xlsxwriter/chart.py index 77310866..a8a2f1f9 100644 --- a/xlsxwriter/chart.py +++ b/xlsxwriter/chart.py @@ -70,7 +70,7 @@ def __init__(self, options=None): self.show_blanks = "gap" self.show_na_as_empty = False self.show_hidden = False - self.show_crosses = 1 + self.show_crosses = True self.width = 480 self.height = 288 self.x_scale = 1 @@ -722,10 +722,7 @@ def _convert_axis_args(self, axis, user_options): "text_axis": False, } - if "visible" in options: - axis["visible"] = options.get("visible") - else: - axis["visible"] = 1 + axis["visible"] = options.get("visible", True) # Convert the display units. axis["display_units"] = self._get_display_units(axis["display_units"]) diff --git a/xlsxwriter/chart_area.py b/xlsxwriter/chart_area.py index c764bd01..61d05dcf 100644 --- a/xlsxwriter/chart_area.py +++ b/xlsxwriter/chart_area.py @@ -38,7 +38,7 @@ def __init__(self, options=None): self.subtype = "standard" self.cross_between = "midCat" - self.show_crosses = 0 + self.show_crosses = False # Override and reset the default axis values. if self.subtype == "percent_stacked": diff --git a/xlsxwriter/chart_bar.py b/xlsxwriter/chart_bar.py index 07820462..4c689f2c 100644 --- a/xlsxwriter/chart_bar.py +++ b/xlsxwriter/chart_bar.py @@ -42,7 +42,7 @@ def __init__(self, options=None): self.val_axis_position = "b" self.horiz_val_axis = 0 self.horiz_cat_axis = 1 - self.show_crosses = 0 + self.show_crosses = False # Override and reset the default axis values. self.x_axis["defaults"]["major_gridlines"] = {"visible": 1} diff --git a/xlsxwriter/chart_stock.py b/xlsxwriter/chart_stock.py index 2e68cb0a..0cc23e06 100644 --- a/xlsxwriter/chart_stock.py +++ b/xlsxwriter/chart_stock.py @@ -28,7 +28,7 @@ def __init__(self, options=None): """ super(ChartStock, self).__init__() - self.show_crosses = 0 + self.show_crosses = False self.hi_low_lines = {} self.date_category = True