An example of creating a simple chart with different fonts.
#include "xlsxwriter.h"
int main() {
.color = 0x7030A0};
}
void chart_axis_set_num_font(lxw_chart_axis *axis, lxw_chart_font *font)
Set the font properties for the numbers of a chart axis.
void chart_axis_set_name(lxw_chart_axis *axis, const char *name)
Set the name caption of the an axis.
lxw_chart_series * chart_add_series(lxw_chart *chart, const char *categories, const char *values)
Add a data series to a chart.
@ LXW_CHART_LINE
Definition: chart.h:126
void chart_title_set_name(lxw_chart *chart, const char *name)
Set the title of the chart.
@ LXW_CHART_LEGEND_BOTTOM
Definition: chart.h:180
void chart_title_set_name_font(lxw_chart *chart, lxw_chart_font *font)
Set the font properties for a chart title.
void chart_legend_set_font(lxw_chart *chart, lxw_chart_font *font)
Set the font properties for a chart legend.
void chart_axis_set_name_font(lxw_chart_axis *axis, lxw_chart_font *font)
Set the font properties for a chart axis name.
void chart_legend_set_position(lxw_chart *chart, uint8_t position)
Set the position of the chart legend.
@ LXW_TRUE
Definition: common.h:54
Struct to represent a chart font.
Definition: chart.h:700
int32_t rotation
Definition: chart.h:724
uint8_t bold
Definition: chart.h:709
const char * name
Definition: chart.h:703
Struct to represent an Excel chart.
Definition: chart.h:1091
lxw_chart_axis * x_axis
Definition: chart.h:1106
lxw_chart_axis * y_axis
Definition: chart.h:1112
Struct to represent an Excel workbook.
Definition: workbook.h:293
Struct to represent an Excel worksheet.
Definition: worksheet.h:2115
#define CELL(cell)
Convert an Excel A1 cell string into a (row, col) pair.
Definition: utility.h:46
lxw_chart * workbook_add_chart(lxw_workbook *workbook, uint8_t chart_type)
Create a new chart to be added to a worksheet:
lxw_workbook * workbook_new(const char *filename)
Create a new workbook object.
lxw_error workbook_close(lxw_workbook *workbook)
Close the Workbook object and write the XLSX file.
lxw_worksheet * workbook_add_worksheet(lxw_workbook *workbook, const char *sheetname)
Add a new worksheet to a workbook.
lxw_error worksheet_insert_chart(lxw_worksheet *worksheet, lxw_row_t row, lxw_col_t col, lxw_chart *chart)
Insert a chart object into a worksheet.
lxw_error worksheet_write_number(lxw_worksheet *worksheet, lxw_row_t row, lxw_col_t col, double number, lxw_format *format)
Write a number to a worksheet cell.