Exincs PlotControlLibrary has two-layered architecture which reflects two aspects of any diagram: on the one hand, a diagram consists of the hierarchy of logical elements (e.g. plot lines, grids, labels, etc.); on the other hand, any diagram is nothing but set of shapes that are drawn on diagram area.

While creating a strongly customized plot, developer may want to access and modify both “logical” and “physical” structure of the plot. Examples of need for logical structure modification are when developer says “I want a horizontal zero grid line to be drawn in a special way” or “I want those two plots to have the same grid but different vertical value labels”. Oppositely, the need to “make all vertical lines thinner” requires modification of shapes, i.e. “physical” structure of plot control.

Architecture of Exincs plot control is shown on the figure below.

Architecture of the PlotControlLibrary

Logical layer (or diagram elements layer) is a set of classes derived from DiagramElement. Each diagram element has its parent element and child elements. The plot control has the only element which is root of plot control elements tree. The explicit function plot control root element normally has children of type ExplicitFunctionPlotItem which represents a single explicit function plot. An instance of ExplicitFunctionPlotItem contains child elements representing plot line, grid and labels.

Whenever the entire diagram (containing set of plots) must be drawn, a set of shapes (lines, ovals, text labels, etc.) is generated. Those shapes constitute “physical” layer of the control. Any shape in Exincs library is derived from DiagramShape class. Each diagram element has references to the set of shapes it generated. By adding custom shapes, applied programmer can draw complex images on plot area in physical screen coordinates. Moreover, developer can change the appearance of auto-generated shapes. The correspondence between logical and physical elements gives the developer virtually infinite customization possibilities.

Shapes layer is updated every time the plot area is redrawn. This usually happens when Redraw() method is invoked, plot is reside etc. Developer may modify the shapes layer by subscribing to DiagramShapesPrepared event which occurs after shapes layer re-generation but before shapes are drawn to the screen.

Diagram Elements

Every diagram element (an element of plot logical structure) in Exincs library is derived from DiagramElement class. This base class unites features common for all diagram elements: The hierarchy of diagram elements is shown on the figure below.

Hierarchy of diagram elements

Diagram Shapes

DiagramShape is the base class for all shapes – bricks of the “physical” layer. The main method of diagram shapes is Draw() which renders the shape to the screen (actually to System.Drawing.Graphics object). The hierarchy of shapes is shown on the figure below.

Hierarchy of shapes

For more detailed description of PlotControlLibrary object model see the documentation.