def timeExample4(netPlot, plotNumber): """Time series chart passing the time (from Netplot.GetTimeNowString()) and the y value""" plotConfig = PlotConfig() plotConfig.plotName="Plot 0" plotConfig.xAxisName="The X axis" plotConfig.yAxisName="Y axis (Plot0)" plotConfig.enableLines=1 plotConfig.enableShapes=1 plotConfig.enableAutoScale=1 plotConfig.maxAgeSeconds=5 netPlot.setPlotType('time', title="%d: TIME chart using Netplot.GetTimeNowString()." % (plotNumber) ) netPlot.addPlot(plotConfig) plotConfig.plotName="Plot 1" #Add a new Y Axis plotConfig.yAxisName="Y Axis (Plot1)" netPlot.addPlot(plotConfig) #Update first plot i=0 while i<10: netPlot.addTimePlotValue(0, NetPlot.GetTimeNowString(), float(1.395*random.randint(0,10) ) ) i=i+1 time.sleep(0.1) netPlot.update()
def timeExample3(netPlot, plotNumber): """Two plots on a time series chart with different Y axis""" plotConfig = PlotConfig() plotConfig.plotName = "Plot 0" plotConfig.xAxisName = "The X axis" plotConfig.yAxisName = "Y axis (Plot0)" plotConfig.enableLines = 1 plotConfig.enableShapes = 1 plotConfig.enableAutoScale = 1 #plotConfig.minScaleValue=0 #plotConfig.maxScaleValue=10000 plotConfig.maxAgeSeconds = 5 netPlot.setPlotType( 'time', title= "%d: TIME chart, two traces with different linear Y scales, both autoscaled" % (plotNumber)) netPlot.addPlot(plotConfig) plotConfig.plotName = "Plot 1" #Add a new Y Axis plotConfig.yAxisName = "Y Axis (Plot1)" netPlot.addPlot(plotConfig) i = 0 while i < 10: netPlot.addPlotValues( [random.randint(1000, 10000), random.randint(10, 100)]) i = i + 1
def timeExample4(netPlot, plotNumber): """Time series chart passing the time (from Netplot.GetTimeNowString()) and the y value""" plotConfig = PlotConfig() plotConfig.plotName = "Plot 0" plotConfig.xAxisName = "The X axis" plotConfig.yAxisName = "Y axis (Plot0)" plotConfig.enableLines = 1 plotConfig.enableShapes = 1 plotConfig.enableAutoScale = 1 plotConfig.maxAgeSeconds = 5 netPlot.setPlotType( 'time', title="%d: TIME chart using Netplot.GetTimeNowString()." % (plotNumber)) netPlot.addPlot(plotConfig) plotConfig.plotName = "Plot 1" #Add a new Y Axis plotConfig.yAxisName = "Y Axis (Plot1)" netPlot.addPlot(plotConfig) #Update first plot i = 0 while i < 10: netPlot.addTimePlotValue(0, NetPlot.GetTimeNowString(), float(1.395 * random.randint(0, 10))) i = i + 1 time.sleep(0.1) netPlot.update()
def timeExample5(netPlot, plotNumber): """Time series chart passing the time and the y value""" plotConfig = PlotConfig() plotConfig.plotName = "Plot 0" plotConfig.xAxisName = "The X axis" plotConfig.yAxisName = "Y axis (Plot0)" plotConfig.enableLines = 1 plotConfig.enableShapes = 1 plotConfig.enableAutoScale = 1 plotConfig.maxAgeSeconds = 5 netPlot.setPlotType( 'time', title="%d: TIME chart, passing the time and the y value (cached)." % (plotNumber)) netPlot.addPlot(plotConfig) plotConfig.plotName = "Plot 1" #Add a new Y Axis plotConfig.yAxisName = "Y Axis (Plot1)" netPlot.addPlot(plotConfig) #We enable cache on this plot. Therefore #data won't be sent until the netPlot.update() method is called. netPlot.enableCache(True) t1 = datetime.now() #Update first plot i = 0 while i < 10: netPlot.addTimePlotValue(0, t1, float(1.395 * random.randint(0, 10))) t1 = t1 + timedelta(seconds=60 * 60 * 24 * 365) i = i + 1 t2 = datetime.now() t2 = t2 + timedelta(seconds=10000) #Update second plot i = 0 while i < 10: netPlot.addTimePlotValue(1, t2, float(1.395 * random.randint(0, 10))) t2 = t2 + timedelta(seconds=60 * 60 * 24 * 365) i = i + 1 netPlot.update()
def timeExample5(netPlot, plotNumber): """Time series chart passing the time and the y value""" plotConfig = PlotConfig() plotConfig.plotName="Plot 0" plotConfig.xAxisName="The X axis" plotConfig.yAxisName="Y axis (Plot0)" plotConfig.enableLines=1 plotConfig.enableShapes=1 plotConfig.enableAutoScale=1 plotConfig.maxAgeSeconds=5 netPlot.setPlotType('time', title="%d: TIME chart, passing the time and the y value (cached)." % (plotNumber) ) netPlot.addPlot(plotConfig) plotConfig.plotName="Plot 1" #Add a new Y Axis plotConfig.yAxisName="Y Axis (Plot1)" netPlot.addPlot(plotConfig) #We enable cache on this plot. Therefore #data won't be sent until the netPlot.update() method is called. netPlot.enableCache(True) t1 = datetime.now() #Update first plot i=0 while i<10: netPlot.addTimePlotValue(0, t1, float(1.395*random.randint(0,10) ) ) t1=t1+timedelta(seconds=60*60*24*365) i=i+1 t2 = datetime.now() t2=t2+timedelta(seconds=10000) #Update second plot i=0 while i<10: netPlot.addTimePlotValue(1, t2, float(1.395*random.randint(0,10) ) ) t2=t2+timedelta(seconds=60*60*24*365) i=i+1 netPlot.update()
def timeExample3(netPlot, plotNumber): """Two plots on a time series chart with different Y axis""" plotConfig = PlotConfig() plotConfig.plotName="Plot 0" plotConfig.xAxisName="The X axis" plotConfig.yAxisName="Y axis (Plot0)" plotConfig.enableLines=1 plotConfig.enableShapes=1 plotConfig.enableAutoScale=1 #plotConfig.minScaleValue=0 #plotConfig.maxScaleValue=10000 plotConfig.maxAgeSeconds=5 netPlot.setPlotType('time', title="%d: TIME chart, two traces with different linear Y scales, both autoscaled" % (plotNumber) ) netPlot.addPlot(plotConfig) plotConfig.plotName="Plot 1" #Add a new Y Axis plotConfig.yAxisName="Y Axis (Plot1)" netPlot.addPlot(plotConfig) i=0 while i<10: netPlot.addPlotValues([random.randint(1000,10000),random.randint(10,100)]) i=i+1
def timeExample1(netPlot, plotNumber): """Single plot on a time series chart""" plotConfig = PlotConfig() plotConfig.plotName="Plot 0" plotConfig.xAxisName="The X axis" plotConfig.yAxisName="The Y axis (Plot0)" plotConfig.enableLines=1 plotConfig.enableShapes=1 plotConfig.enableAutoScale=0 plotConfig.minScaleValue=0 plotConfig.maxScaleValue=10000 plotConfig.maxAgeSeconds=5 plotConfig.tickCount=1000 netPlot.setPlotType('time', title="%d: TIME chart, single plot" % (plotNumber) ) #Uncomment this to remove the Legend on the chart #netPlot.setChartLegendEnabled(0) netPlot.addPlot(plotConfig) i=0 while i< 10: netPlot.addPlotValues([random.randint(1000,10000)]) i=i+1
def timeExample1(netPlot, plotNumber): """Single plot on a time series chart""" plotConfig = PlotConfig() plotConfig.plotName = "Plot 0" plotConfig.xAxisName = "The X axis" plotConfig.yAxisName = "The Y axis (Plot0)" plotConfig.enableLines = 1 plotConfig.enableShapes = 1 plotConfig.enableAutoScale = 0 plotConfig.minScaleValue = 0 plotConfig.maxScaleValue = 10000 plotConfig.maxAgeSeconds = 5 plotConfig.tickCount = 1000 netPlot.setPlotType('time', title="%d: TIME chart, single plot" % (plotNumber)) #Uncomment this to remove the Legend on the chart #netPlot.setChartLegendEnabled(0) netPlot.addPlot(plotConfig) i = 0 while i < 10: netPlot.addPlotValues([random.randint(1000, 10000)]) i = i + 1