Ist zwar ne Weile her, aber:
Code: Alles auswählen
def chart_range_change(form, sheet, chart, row_start, row_end):
oAdr = [sheet[row_start:row_end, 0].RangeAddress]
names = ["chb_esp_aussen",
"chb_raspi_iu",
"chb_rapi_io",
"chb_rapi_timecontrol",
"chb_lf",
"chb_heaterstatus",
"chb_fanstatus",
"chb_timecontrolstatus"]
for c, name in enumerate(names, 2):
if form[name].State:
oAdr.append( sheet[row_start:row_end, c]].RangeAddress)
oChart.setRanges(oAdr)
def main(*args):
oDoc = XSCRIPTCONTEXT.getDocument()
sheet_diagramm = oDoc.Sheets[0]
sheet_thingspeak = oDoc.Sheets[1]
form = sheet_diagramm.DrawPage.Forms[0]
oChart = sheet_diagramm.Charts[0]
row_start = 2
row_end = 999
chart_range_change(form, sheet_thingspeak, oChart, row_start, row_end)