Scatter charts are broken
Created originally on Bitbucket by Marginal42 (JonathanH)
Two issues in the new charts implementation:
- Attempting to label a data series with the series name has no effect (this affects all charts, but you would mostly likely want to do this with scatter and pie charts).
- Scatter charts are broken / unusable
The fixes are trivial. Patch below.
#!patch
--- openpyxl/chart/label.py.bak 2015-06-29 21:39:41.000000000 +0100
+++ openpyxl/chart/label.py 2015-07-22 03:30:06.000000000 +0100
@@ -42,7 +42,7 @@
extLst = Typed(expected_type=ExtensionList, allow_none=True)
__elements__ = ("delete", "numFmt", "spPr", "txPr", "dLblPos",
- "showLegendKey", "showVal", "showCatName", "showPercent",
+ "showLegendKey", "showVal", "showCatName", "showSerName", "showPercent",
"showBubbleSize", "showLeaderLines", "separator")
def __init__(self,
--- openpyxl/chart/scatter_chart.py.bak 2015-06-29 21:39:41.000000000 +0100
+++ openpyxl/chart/scatter_chart.py 2015-07-22 03:32:07.000000000 +0100
@@ -25,7 +25,7 @@
scatterStyle = NestedNoneSet(values=(['line', 'lineMarker', 'marker', 'smooth', 'smoothMarker']))
varyColors = NestedBool(allow_none=True)
- ser = Typed(expected_type=XYSeries, allow_none=True)
+ ser = Sequence(expected_type=XYSeries, allow_none=True)
dLbls = Typed(expected_type=DataLabels, allow_none=True)
dataLabels = Alias("dLbls")
extLst = Typed(expected_type=ExtensionList, allow_none=True)
@@ -40,7 +40,7 @@
def __init__(self,
scatterStyle=None,
varyColors=None,
- ser=None,
+ ser=(),
dLbls=None,
axId=None,
extLst=None,