def initWidget(widget): global graphs graphs[0] = karamba.getThemeGraph(widget, "graph0") graphs[1] = karamba.getThemeGraph(widget, "graph1") graphs[2] = karamba.getThemeGraph(widget, "graph2") graphs[3] = karamba.getThemeGraph(widget, "graph3") graphs[4] = karamba.getThemeGraph(widget, "graph4") graphs[5] = karamba.getThemeGraph(widget, "graph5") graphs[6] = karamba.getThemeGraph(widget, "graph6") graphs[7] = karamba.getThemeGraph(widget, "graph7")
def initWidget(widget): global graphs, labels graphs[0] = karamba.getThemeGraph(widget, "graphLeft") graphs[1] = karamba.getThemeGraph(widget, "graphDown") graphs[2] = karamba.getThemeGraph(widget, "graphFilled") graphs[3] = karamba.getThemeGraph(widget, "graphMin") labels[0] = karamba.getThemeText(widget, "downValue") labels[1] = karamba.getThemeText(widget, "leftValue") labels[2] = karamba.getThemeText(widget, "filledValue") labels[3] = karamba.getThemeText(widget, "minValue") # most of these values are already present in the theme # these are here to show examples of how to work with the # advanced graphing attributes in python # set fill color for last two graphs karamba.setGraphFillColor(widget, graphs[2], 0, 150, 255, 100) karamba.setGraphFillColor(widget, graphs[3], 0, 150, 255, 100) # setting shouldFill only available in python but it is not # needed if the fill color is set. This call allows the fill # to be easily toggled programmatically. karamba.setGraphShouldFill(widget, graphs[0], 0) karamba.setGraphShouldFill(widget, graphs[1], 0) karamba.setGraphShouldFill(widget, graphs[2], 1) karamba.setGraphShouldFill(widget, graphs[3], 1) karamba.setGraphPlot(widget, graphs[0], "up") karamba.setGraphPlot(widget, graphs[1], "down") karamba.setGraphPlot(widget, graphs[2], "up") karamba.setGraphPlot(widget, graphs[3], "up") karamba.setGraphScroll(widget, graphs[0], "left") karamba.setGraphScroll(widget, graphs[1], "right") karamba.setGraphScroll(widget, graphs[2], "right") karamba.setGraphScroll(widget, graphs[3], "right")