Hi Klaus,

Since you are using Apps Script to draw your charts (via Google Charts),
you should probably ask people who can help with Apps Script first.   Their
docs (
https://developers.google.com/apps-script/reference/spreadsheet/embedded-chart)
link to StackOverflow for user questions:
https://stackoverflow.com/questions/tagged/google-apps-script

The Google Charts API has not changed recently, and generally we only add
features and fix bugs.

On Mon, Jun 12, 2017 at 12:29 PM, klusek <[email protected]> wrote:

> Dear all,
> after hours of searching in the internet and endless trys I decided to
> post my problem in this forum.
>
> I guess Google changed the chart api because my code is not working
> anymore.
>
> Therefore I would be very happy if someone of the gifted programmers in
> this forum could help me.
>
> My code is actual looking like this:
>
>  var sheet_vokabeln = SpreadsheetApp.getActiveSpreadsheet().
> getSheetByName("Vokabeln");
>  var sheet_Magnetkupplung = SpreadsheetApp.getActiveSpreadsheet().
> getSheetByName("Magnetkupplung");
>  var sheet_kennlinie = SpreadsheetApp.getActiveSpreadsheet().
> getSheetByName("Kennlinie");
>  var sheet_kennliniendaten = SpreadsheetApp.getActiveSpreadsheet().
> getSheetByName("Kennliniendaten");
>  var text_y_achse_Foerderhoehe = sheet_kennliniendaten.
> getRange("I62").getValue();
>  var text_y_achse_npsh = sheet_kennliniendaten.getRange("I63").getValue();
>  var text_menge = sheet_kennliniendaten.getRange("B49").getValue();
>  var text_P2 = sheet_kennliniendaten.getRange("I65").getValue();
>  var text_wirkungsgrad = sheet_kennliniendaten.getRange("I66").getValue();
>  var minmenge = sheet_Magnetkupplung.getRange("I35").getValue();
>  var maxmenge = sheet_Magnetkupplung.getRange("J35").getValue();
>  var anzahl_messpunkte_kalt = sheet_kennliniendaten.
> getRange("I67").getValue()+62;
>  var anzahl_messpunkte_warm = sheet_kennliniendaten.
> getRange("I68").getValue()+62;
>  var anzahl_messpunkte_npsh = sheet_kennliniendaten.
> getRange("I69").getValue()+63;
>  var range_warm = sheet_kennliniendaten.getRange("B62:C"+anzahl_
> messpunkte_warm);
>  var range_kalt = sheet_kennliniendaten.getRange("D62:D"+anzahl_
> messpunkte_kalt);
>  var range_npsh = sheet_kennliniendaten.getRange("E62:E"+anzahl_
> messpunkte_npsh);
>  var range_P2warm = sheet_kennliniendaten.getRange("K62:L"+anzahl_
> messpunkte_warm);
>  var range_P2kalt = sheet_kennliniendaten.getRange("M62:M"+anzahl_
> messpunkte_kalt);
>  var range_eff = sheet_kennliniendaten.getRange("N62:N"+anzahl_
> messpunkte_warm);
>  var hmax = sheet_kennliniendaten.getRange("I70").getValue();
>
>  var xparameters = {
>    "title": text_menge,
>    "fontName":"Arial",
>    "minValue":minmenge,
>    "maxValue":maxmenge,
>    "titleTextStyle": {
>      "color": "#c0c0c0",
>      "fontSize": 10,
>      "fontName":"Roboto",
>      "italic": true,
>      "bolt": false
>     }
>  };
>
>   var y1parameters = {
>    "title": text_y_achse_Foerderhoehe,
>    "fontName":"Arial",
>    "minValue":0,
>    "maxValue":hmax,
>    "titleTextStyle": {
>      "color": "#c0c0c0",
>      "fontSize": 10,
>      "fontName":"Roboto",
>      "italic": true,
>      "bolt": false
>     }
>  };
>
>    var y2parameters = {
>    "title": text_y_achse_npsh,
>    "fontName":"Arial",
>    "minValue":0,
>    "maxValue":10,
>    "titleTextStyle": {
>      "color": "#c0c0c0",
>      "fontSize": 10,
>      "fontName":"Roboto",
>      "italic": true,
>      "bolt": false
>     }
>  };
>
>
>
> var chart = sheet_kennlinie.getCharts()[0];
>  var old_ranges_oben = chart.getRanges();
>
>    for (var i in old_ranges_oben) {
>   var bereich = old_ranges_oben[i];
>    chart = chart.modify()
>   .removeRange(bereich)
>     .build();
>  }
>
>  chart = chart.modify()
> .addRange(range_warm)
> .addRange(range_kalt)
> .addRange(range_npsh)
> .setOption('vAxis'[0], y1parameters)
> .setOption('vAxis'[1], y2parameters)
> .setOption('hAxis',xparameters)
> .setOption('width', 636)
> .setOption('height', 391)
> .setOption('legend', {position: 'up', textStyle: {fontSize: 12}})
> .setPosition(10,1,2,1)
> .build();
>
> sheet_kennlinie.updateChart(chart);
>
> the problem is that the code does not change the properties of the
>  y-axes. Furthermore the legend is not shown anymore. there is no error
> message.
>
> Does anyone could help please!
>
> thanks in advance
> klusek
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization 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 google-visualization-api@
> googlegroups.com.
> Visit this group at https://groups.google.com/
> group/google-visualization-api.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-visualization-api/f5be0833-401d-4d0b-aa97-
> a9296d253af1%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/f5be0833-401d-4d0b-aa97-a9296d253af1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
[email protected] <[email protected]>   5CC, Cambridge MA

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization 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-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJOknwoB0JRXYhzNkngXsh7_2ur5L%2BOveAE7y6imRLFgRg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to