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 [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/f5be0833-401d-4d0b-aa97-a9296d253af1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.