[GH-ISSUE #147] Feature request: Plotarea options for Pie chart #120

Closed
opened 2026-05-05 11:42:44 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @RaFaeL-NN on GitHub (Feb 10, 2018).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/147

Originally assigned to: @jmcnamara on GitHub.

No code for writing c:spPr in _chart_write_pie_plot_area. Why? I can set it in Excel runtime...
piecolors

Can you add this lines of code for pie and doughnut charts too?

Originally created by @RaFaeL-NN on GitHub (Feb 10, 2018). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/147 Originally assigned to: @jmcnamara on GitHub. No code for writing c:spPr in _chart_write_pie_plot_area. Why? I can set it in Excel runtime... ![piecolors](https://user-images.githubusercontent.com/34895749/36066170-964af0ca-0eb6-11e8-9953-aa0269720735.png) Can you add this lines of code for pie and doughnut charts too?
gitea-mirror 2026-05-05 11:42:44 -06:00
Author
Owner

@jmcnamara commented on GitHub (Feb 10, 2018):

I’ll try. What is that feature called in English?

<!-- gh-comment-id:364690315 --> @jmcnamara commented on GitHub (Feb 10, 2018): I’ll try. What is that feature called in English?
Author
Owner

@RaFaeL-NN commented on GitHub (Feb 10, 2018):

Format Plot Area
It's same with another type of charts, no differenсe. May be, just in size of area...

<!-- gh-comment-id:364692850 --> @RaFaeL-NN commented on GitHub (Feb 10, 2018): Format Plot Area It's same with another type of charts, no differenсe. May be, just in size of area...
Author
Owner

@RaFaeL-NN commented on GitHub (Feb 10, 2018):

`/*

  • Write the <c:plotArea> element. Special handling for pie/doughnut.
    */
    STATIC void
    _chart_write_pie_plot_area(lxw_chart *self)
    {
    lxw_xml_start_tag(self->file, "c:plotArea", NULL);

    /* Write the c:layout element. */
    _chart_write_layout(self);

    /* Write subclass chart type elements for primary and secondary axes. */
    self->write_chart_type(self);

    /* Write the c:spPr element for the plotarea formatting. */
    _chart_write_sp_pr(self, self->plotarea_line, self->plotarea_fill,
    self->plotarea_pattern);

    lxw_xml_end_tag(self->file, "c:plotArea");
    } `

It works

<!-- gh-comment-id:364695226 --> @RaFaeL-NN commented on GitHub (Feb 10, 2018): `/* * Write the <c:plotArea> element. Special handling for pie/doughnut. */ STATIC void _chart_write_pie_plot_area(lxw_chart *self) { lxw_xml_start_tag(self->file, "c:plotArea", NULL); /* Write the c:layout element. */ _chart_write_layout(self); /* Write subclass chart type elements for primary and secondary axes. */ self->write_chart_type(self); /* Write the c:spPr element for the plotarea formatting. */ _chart_write_sp_pr(self, self->plotarea_line, self->plotarea_fill, self->plotarea_pattern); lxw_xml_end_tag(self->file, "c:plotArea"); } ` It works
Author
Owner

@jmcnamara commented on GitHub (Feb 11, 2018):

Yes. That feature should be supported by default. I'll add it in a later release.

<!-- gh-comment-id:364707407 --> @jmcnamara commented on GitHub (Feb 11, 2018): Yes. That feature should be supported by default. I'll add it in a later release.
Author
Owner

@RaFaeL-NN commented on GitHub (Feb 11, 2018):

I think it's a bug. Based on docs for chart_plotarea_set_* functions, no exceptions for some type of charts

<!-- gh-comment-id:364758828 --> @RaFaeL-NN commented on GitHub (Feb 11, 2018): I think it's a bug. Based on docs for chart_plotarea_set_* functions, no exceptions for some type of charts
Author
Owner

@jmcnamara commented on GitHub (Feb 11, 2018):

It is a bug of sorts.

I deliberately left out support for it because I mistakenly thought that it wasn’t supported for those types of charts.

I’ll add it back in an upcoming release once I add some tests etc.

<!-- gh-comment-id:364761785 --> @jmcnamara commented on GitHub (Feb 11, 2018): It is a bug of sorts. I deliberately left out support for it because I mistakenly thought that it wasn’t supported for those types of charts. I’ll add it back in an upcoming release once I add some tests etc.
Author
Owner

@jmcnamara commented on GitHub (Apr 2, 2018):

Fixed on master. Thanks for the report. Closing.

<!-- gh-comment-id:378020326 --> @jmcnamara commented on GitHub (Apr 2, 2018): Fixed on master. Thanks for the report. Closing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#120
No description provided.