I create the online chart from my pivot table.that pivot table is source my chart.but i can't get chart data table in office script
I need to add "chart data table" from office script code
Here is my code. I don't have any idea how to add that data table in chart.
// Insert pivot chart on sheet sheet1
let chart_1 = sheet1.addChart(ExcelScript.ChartType.columnClustered, newPivotTable.getLayout().getRange());
// Resize and move chart chart_1
chart_1.setLeft(543.75);
chart_1.setTop(24.75);
chart_1.setWidth(360);
chart_1.setHeight(216);
// Resize and move chart chart_1
chart_1.setLeft(543.75);
chart_1.setTop(24.75);
chart_1.setWidth(468);
chart_1.setHeight(273);
// Change major gridlines visibility for chart chart_1
chart_1.getAxes().getValueAxis().getMajorGridlines().setVisible(false);
// Change minor gridlines visibility for chart chart_1
chart_1.getAxes().getValueAxis().getMinorGridlines().setVisible(false);
// Change title text for chart chart_1
chart_1.getTitle().setText("Active HC");