scanny / python-pptx

Create Open XML PowerPoint documents in Python
MIT License
2.35k stars 510 forks source link

Change points color in scatter plot #825

Open LogOpsBolivar01 opened 2 years ago

LogOpsBolivar01 commented 2 years ago

I am trying to change color in scatter plot as it can be done in other charts:

chart_data = pptx.chart.data.XyChartData()

series_1 = chart_data.add_series('A') series_1.add_data_point(0.7, 2.7) series_1.add_data_point(1.8, 3.2) series_1.add_data_point(2.6, 0.8)

series_2 = chart_data.add_series('B') series_2.add_data_point(1.3, 3.7) series_2.add_data_point(2.7, 2.3) series_2.add_data_point(1.6, 1.8)

chart = slide.shapes.add_chart( XL_CHART_TYPE.XY_SCATTER, Inches(0.1), Inches(0.3), Inches(4), Inches(4), chart_data ).chart

for point in chart.series[0].points: fill = point.format.fill #fill the legend as well fill.solid() fill.fore_color.rgb = RGBColor.from_string('016D38')

But, instead of colouring the points, it draws a line:

image

¿How can I change the color of the points?

TokeyChan commented 1 year ago

I got the same problem, haven't found out how to color them yet

LogOpsBolivar01 commented 1 year ago

Unfortunately, I have not found a solution.