I am trying to generate line chart using python-pptx, and I am able to generate chart using below code.
chart_data = ChartData()
chart_data.categories = ['Q1 Sales', 'Q2 Sales', 'Q3 Sales']
chart_data.add_series('West', (32.2, 28.4, 34.7))
chart_data.add_series('East', (24.3, 30.6, 20.2))
chart_data.add_series('Midwest', (20.4, 18.3, 26.2))
x, y, cx, cy = Inches(2), Inches(2), Inches(6), Inches(4.5)
chart = slide.shapes.add_chart(
XL_CHART_TYPE.LINE, x, y, cx, cy, chart_data
).chart
chart.has_legend = True
chart.legend.include_in_layout = False
This will generate a graph like this http://python-pptx.readthedocs.org/en/latest/_images/chart-06.png a line series with three points.
My requirement is- for "East" I don't have second point, so the line for "East" should be a breaking line, only two point will show first and third.
I tried below by making it empty but didn't work
chart_data.add_series('East', (24.3, "", 20.2))
Is there any way to achieve this? Its possible in high charts but not supported in ppt.
I am trying to achieve something like this:
Thanks in advance.