MathNya / umya-spreadsheet

A pure rust library for reading and writing spreadsheet files
MIT License
240 stars 41 forks source link

The actual result of the line chart example is a stack line chart #89

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hi, thanks for the greate job !

I refer to the code of the chart example. The line chart example actually shows a stack line chart, but I need a line chart. How can I draw an actual line chart?

line chart example :

mmexport1672412097224

excel line chart(what i need): mmexport1672412099796

MathNya commented 1 year ago

Thank you for contacting us. We have a method to change to actual line chart. After obtaining the latest version, please implement it as shown in the example below.

example (The bottom method is it.)

    let mut chart = umya_spreadsheet::structs::Chart::default();
    chart
        .new_chart(
            umya_spreadsheet::structs::ChartType::LineChart,
            from_marker,
            to_marker,
            area_chart_series_list,
        )
        .set_series_title(series_title_list)
        .set_series_point_title(series_point_title_list)
        .set_default_language("ja-JP")
        .set_title("Chart Title")
        .set_horizontal_title("Horizontal Title")
        .set_vertical_title("Vertical Title")
        .set_grouping(umya_spreadsheet::drawing::charts::GroupingValues::Standard);
ghost commented 1 year ago

The latest version has solved my problem well, thank you!