chartcheet on libxlsxwriter

94 Views Asked by At

I'm trying to use the libxlsxwriter C library but I'm struggling to make chartsheets on a new excel sheet (and not a basic chart on a sheet between formulas).

Any Ideas ? Even on how-to hardcode this ?

Edit This is what I've done so far :

lxw_worksheet *ChartWorksheet = workbook_add_worksheet(workbook, "TTime");
lxw_chart *chart = workbook_add_chart(workbook, LXW_CHART_SCATTER);

lxw_chart_series *AutoWarmSerie = chart_add_series(chart, "", "");
chart_series_set_name(AutoWarmSerie, "AutoEchauff");

// fill the series
chart_series_set_categories(AutoWarmSerie, DataWorksheet->name, 4, Idx, 4 + m_AutoWarmTime.size(), m_DataColumnIdx); // Time
chart_series_set_values(AutoWarmSerie, DataWorksheet->name, 4, m_DataColumnIdx + 1, 4 + m_AutoWarmTime.size(), m_DataColumnIdx + 1); // Temperature

/* Add a chart title and some axis labels. */
chart_title_set_name(chart, "Results of sample analysis");
chart_axis_set_name(chart->x_axis, "Test number");
chart_axis_set_name(chart->y_axis, "Sample length (mm)");

/* Set an Excel chart style. */
chart_set_style(chart, 11);

/* Insert the chart into the worksheet. */
worksheet_insert_chart(ChartWorksheet, CELL("E2"), chart);

But I only get a single chart box on a sheet, and I dunno how to make the box a whole sheet, so...

1

There are 1 best solutions below

0
On

Chartsheets aren't currently available in libxlsxwriter but they are a planned feature.

Update: Chartsheet support has been added to libxlsxwriter in version 0.8.0.