Skip to content

Commit

Permalink
chart: add minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcnamara committed Jun 14, 2024
1 parent 02d27d4 commit 1722118
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
6 changes: 3 additions & 3 deletions dev/docs/source/working_with_charts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.


Expand Down
2 changes: 1 addition & 1 deletion examples/chart_combined.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 2 additions & 5 deletions xlsxwriter/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"])
Expand Down
2 changes: 1 addition & 1 deletion xlsxwriter/chart_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
2 changes: 1 addition & 1 deletion xlsxwriter/chart_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion xlsxwriter/chart_stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1722118

Please sign in to comment.