I made a google Apps script to modify a chart and I would like to display 
the data label of the series number 0 but the line .setOption('series',{ 
1:{color: '#2ecc71'}}) (where I change the color of the series 1) remove 
the data label of the series 0.

 

      var Vmax =1.1*ss.getRangeByName("D285").getValue(); //get max and min 
here (before, it's equal to 0)
      var Vmin =0.9*ss.getRangeByName("C285").getValue(); 
      var sheet = SpreadsheetApp.getActiveSheet();
      var chart = sheet.getCharts()[46];
      chart = chart.modify()
        .setChartType(Charts.ChartType.AREA)
        .setOption('title',string)
        .setOption('vAxes', {0: {textStyle: {fontSize: 10}, titleTextStyle: 
{fontSize : 8}, viewWindow: {min: Vmin, max:Vmax}}})
        .setOption('series',{ 1:{color: '#2ecc71'}})
        .setOption('titleTextStyle',{alignment:"center"})
        .setOption('animation.startup',true)
        .setOption('animation.duration', 5000)
        .setOption('hAxis.slantedText',true)
        .setPosition(290,6,0,0)
        .build();
        Logger.log(Vmax);
        Logger.log(Vmin);
      sheet.updateChart(chart);

Here is the link to the spreadsheet : 
https://docs.google.com/spreadsheets/d/1JBEcCQQrC8fHgnrLcyxmGFP-4BlIDFZgjlCHIAMeLNU/edit?usp=sharing

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-chart-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-chart-api/73710317-3554-4708-9261-f694bf20faf3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to