The wckgraph package is a simple graph library for the WCK toolkit. To display a diagram, first create a GraphWidget widget, and then add graph components to the diagram.
The following example draws a simple line diagram:
graph = wckgraph.GraphWidget(root) data = xdata, ydata graph.add(wckgraph.Axes(data)) graph.add(wckgraph.LineGraph(data))The Axes component calculates a suitable viewport based on the data, and also draws the axis (including labels). The LineGraph component draws a line diagram into that viewport. You can use options to configure the axes and the graph components.
For details, see below.
(Internal) Drawing context.
For more information about this class, see The _DrawContext Class.
Area plot.
For more information about this class, see The AreaGraph Class.
Standard axes handling.
For more information about this class, see The Axes Class.
Simple bar plot.
For more information about this class, see The BarGraph Class.
Brush object.
For more information about this class, see The Brush Class.
Graph widget.
For more information about this class, see The GraphWidget Class.
Line plot.
For more information about this class, see The LineGraph Class.
Marker object.
For more information about this class, see The Marker Class.
Pen object.
For more information about this class, see The Pen Class.
Scatter (X-Y) plot.
For more information about this class, see The ScatterGraph Class.
Base class for simple graphs.
For more information about this class, see The SimpleGraph Class.
(Internal) Drawing context. A fully populated instance of this class is passed to the graph components during drawing.
Area plot. This is similar to LineGraph, but fills the region beneath the line.
Standard axes handling. This element sets up a drawing extent for subsequent elements, and also draws axes to the left and below the graph area.
Gets the current graph extent.
(Hook) Calculates min and max values for an individual graph axis, and determines where to draw tick marks.
(Internal) Renders axes.
Sets the graph extent.
(Hook) Generates label for the X axis.
(Hook) Generates label for the Y axis.
Simple bar plot.
Brush object. This class is used to specify fill styles for various drawing operations.
Graph widget. To display a graph, add an axis component, and one or more graph components.
Adds a graph component to this widget.
Removes all layers from widget.
Line plot.
Marker object. This is used to specify marker styles for various plotting operations.
Plot markers on a surface.
Pen object. This class is used to specify pen styles for various drawing operations.
Scatter (X-Y) plot.
Base class for simple graphs.
(Hook) Render graph in context. The default implementation maps input coordinates to pixel coordinates, relative to the graph canvas, and then calls the render_xy method.
(Hook) Renders graph in context. Same as render, but the coordinates are given in pixel coordinates.