JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches
Collaboration diagram for Plot Key/Legend:

The class JKQTPBaseKey implements the basic layouting and drawing of a key/legend.

Key/Legend Styling

With JKQTPKeyStyle you can style the appearance of a key/legend:

In addition it is possible to set:

See also
JKQTPBaseKey, JKQTBasePlotter, JKQTBasePlotterStyle, Styling System
Note
The class JKQTPBaseKey offers setters (slots) and getters for all the properties in the used instance of JKQTPKeyStyle .

Usage

The functions in JKQTPBaseKey are mainly used for drawing the main key in a JKQTBasePlotter. The instance representing that main key is accessible via JKQTPBaseKey::getMainKey(). It is not a direct instance of JKQTPBaseKey, which is impossible, as it is pure virtual, but an instance of JKQTPMainKey, which extends JKQTPBaseKey with access to the titles assigned to each JKQTPPlotElement (see JKQTPPlotElement::getTitle(), JKQTPPlotElement::setTitle()) and its key-marker (JKQTPPlotElement::drawKeyMarker()).

Note however that it is also possible to draw additional keys into the graph (e.g. to show the size/color classes in a parametrized scatter graph), if the corresponding JKQTPPlotElement implements this.

Implementation Details

It relies on these protected virtual functions to determine the contents of the legend items:

So you can derive from JKQTPBaseKey and implement these to provide a new source of data.

There are additional customization points in this class. You can also override the default implementations of these functions to change the way keys/legends are drawn:

See also
JKQTPKeyStyle, JKQTPMainKey