How to change the color of These bars? I’m using an Excel API for Javascript

Asked

Viewed 36 times

-1

inserir a descrição da imagem aqui

    var dataRange = sheet.getRange(range);
      var chart = sheet.charts.add("ColumnClustered", dataRange, "Rows");
      chart.axes.valueAxis.minorUnit = 0.2;

      // chart.axes.valueAxis.format.font.

      //                12%
      //                +--+
      //                |  |
      // Acima da barra |  |
      chart.series.getItemAt(0).set({
        // format: { line: { color: 'black', weight: 10}},
        gapWidth: 2,
        dataLabels: {
          format: { font: { name: "Arial", size: 12, bold: false, color: "black" } }
        }
      });

      // chart.format.fill.setSolidColor("orange")

      chart.load('items')

      console.log(`>> ${chart.series.getItemAt(0)}`);

      chart.legend.visible = false;
      chart.dataLabels.format.font.size = 15;
      chart.dataLabels.format.font.color = "black";
      chart.axes.categoryAxis.format.fill.setSolidColor("white");
      chart.series.add();

      chart.axes.valueAxis.majorGridlines.visible = false;
  • 2

    Welcome to Stackoverflow in Portuguese. As the name implies, the Official language used here is English. So, can you Please Translate your Question? If you prefer, you may also Ask this same Question in the English Stackoverflow site.

1 answer

0


After many tests I figured out how to do:

chart.series.getItemAt(0).format.fill.setSolidColor("black")

Browser other questions tagged

You are not signed in. Login or sign up in order to post.