qax-os / excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets

Home Page:https://xuri.me/excelize

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set the cross of XAxis and YAxis using AddChart function?

ffh-zhang opened this issue · comments

The chart generated:
chart_1

The chart I want:
chart_2

commented

Thanks for your issue. This library added new field TickLabelPosition in the ChartAxis option to support set label position of the chart, please upgrade to the master branch code by go get -u github.com/xuri/excelize/v2@master, and this feature will be released in the next version. Now you can set the label position of the horizontal axis like this:

&excelize.Chart{
    Type: excelize.Line,
    XAxis: excelize.ChartAxis{
+       TickLabelPosition: excelize.ChartTickLabelLow,
        ...
    },
    ...
}

Thanks for your prompt response! I have resolved the issue.