[GH-ISSUE #458] Chart title always bold #360

Closed
opened 2026-05-05 12:11:54 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @znakeeye on GitHub (Oct 21, 2024).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/458

Just run this sample:

#include <xlsxwriter.h>

int main()
{
    lxw_workbook* workbook = workbook_new("test.xlsx");
    lxw_worksheet* worksheet = workbook_add_worksheet(workbook, "Sheet1");
    
    lxw_chart* chart = workbook_add_chart(workbook, LXW_CHART_PIE);
    chart_title_set_name(chart, "My Title");
    
    lxw_chart_font font = { 0 };
    font.size = 12;
    font.color = 0xFF0000;
    
    // NOTE: Here font.bold is indeed 0. Why isn't it respected?
    chart_title_set_name_font(chart, &font);

    lxw_chart_series* series = chart_add_series(chart, NULL, "=Sheet1!$N$7");
    
    worksheet_insert_chart(worksheet, CELL("B3"), chart);

    return workbook_close(workbook);
}

And observe that the resulting chart title is always bold:

image

Originally created by @znakeeye on GitHub (Oct 21, 2024). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/458 Just run this sample: ```c #include <xlsxwriter.h> int main() { lxw_workbook* workbook = workbook_new("test.xlsx"); lxw_worksheet* worksheet = workbook_add_worksheet(workbook, "Sheet1"); lxw_chart* chart = workbook_add_chart(workbook, LXW_CHART_PIE); chart_title_set_name(chart, "My Title"); lxw_chart_font font = { 0 }; font.size = 12; font.color = 0xFF0000; // NOTE: Here font.bold is indeed 0. Why isn't it respected? chart_title_set_name_font(chart, &font); lxw_chart_series* series = chart_add_series(chart, NULL, "=Sheet1!$N$7"); worksheet_insert_chart(worksheet, CELL("B3"), chart); return workbook_close(workbook); } ``` And observe that the resulting chart title is always bold: ![image](https://github.com/user-attachments/assets/1edb434e-4c8f-4fe7-8f86-be7036835322)
Author
Owner

@znakeeye commented on GitHub (Oct 21, 2024):

Sorry, didn't search properly before writing the report. Closing.

LXW_EXPLICIT_FALSE to the rescue 👍

<!-- gh-comment-id:2427578335 --> @znakeeye commented on GitHub (Oct 21, 2024): Sorry, didn't search properly before writing the report. Closing. `LXW_EXPLICIT_FALSE` to the rescue 👍
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#360
No description provided.