-
Notifications
You must be signed in to change notification settings - Fork 3
2.2 DirectDiagram
line diagram widget to show a range of values.
from DirectGuiExtension.DirectDiagram import DirectDiagram
data = [10, -5, 1, -8, 15, 8, 20, -19, 3, -4]
dd = DirectDiagram(
data=data,
numberAreaWidth=0.15,
numNegSteps=20,
numPosSteps=20,
numNegStepsStep=2,
numPosStepsStep=2,
stepFormat=int,
numtextScale=0.04,
frameSize=(-.5, .5, -.25 .25))
# update the diagram data
newData = ... some data processing ...
dd["data"] = newDatadata: list
A list containing the to be displayed values of this diagram. Values can be of any numeric type
numPosSteps: number
Number of positive steps to be displayed on the diagram. This should at least go up to the highest number given in the data list.
numPosStepsStep: number
The step value at which the positive steps should raise. By default this will be one, so every full step (e.g. 1, 2, 3, etc.) will be shown. If you for example set this to two every second full step will be shown (e.g. 1, 3, 5, etc.)
numNegSteps: number
Number of negative steps to be displayed on the diagram. This should at least go down to the lowest number given in the data list.
numNegStepsStep: number
The step value at which the negative steps should raise. This behaves the same as the nuPosStepsStep does.
numtextScale: float
Scale of the numbers text which are displayed left to the diagram to show the steps.
showDataNumbers: Boolean
If set to True, the data points on the line will be displayed with an additional text stating the exact number.
dataNumtextScale: float
The text scale for the additional data text shown on the diagrams line
stepAccuracy: number
The acurracy to which the data should be rounded up/down to. This is only useful if the data is of a floating point value.
stepFormat: formater (e.g. float, int)
The format function to use on the data. The default is float.
numberAreaWidth: float
Width of the area left to the diagram which shows the diagrams Y-value