exceloffice-scripts

How to position the horizontal axis labels at the bottom low?


How to position the labels (years, in this case) at the very bottom of the cart using Excel Office Scripts?

enter image description here

I've tried this without luck:

chart_3.getAxes().getCategoryAxis().setPosition(ExcelScript.ChartAxisPosition.minimum);

Solution

  • function main(workbook: ExcelScript.Workbook) {
        let cht = workbook.getActiveChart();
        const min_val = cht.getAxes().getValueAxis().getMinimum();
        cht.getAxes().getValueAxis().setPositionAt(min_val);
    }
    

    enter image description here