mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2025-01-12 00:40:32 +08:00
improve doc
This commit is contained in:
parent
61ca14863f
commit
0080f07bda
@ -7,14 +7,15 @@
|
||||
\defgroup jkqtplotter_general_basicplotelements_coordinateaxes Coordinate Axes
|
||||
\ingroup jkqtplotter_general_basicplotelements
|
||||
|
||||
\copydetails JKQTPCoordinateAxis
|
||||
\copydetails JKQTPCoordinateAxis
|
||||
|
||||
|
||||
|
||||
\defgroup jkqtplotter_general_basicplotelements_key Plot Key/Legend
|
||||
\ingroup jkqtplotter_general_basicplotelements
|
||||
|
||||
|
||||
\copydetails JKQTBaseKey
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
@ -52,7 +52,7 @@ typedef JKQTPCoordinateAxes JKQTPCoordinateAxisRef;
|
||||
/*! \brief this virtual class is the base for any type of coordinate axis, to be drawn by JKQTBasePlotter.
|
||||
\ingroup jkqtpbaseplotter_elements
|
||||
|
||||
Class derived from JKQTPCoordinateAxis implements all the functionality needed for a coordinate axis:
|
||||
Classes derived from JKQTPCoordinateAxis implements all the functionality needed for a coordinate axis:
|
||||
- transform world to screen coordinates and vice versa
|
||||
- draw the axis (implemented by child classes!) with these elements: axis lines, ticks, tick labels, axis label, x/y=0 axis
|
||||
- measure the axes in screen coordinates
|
||||
@ -168,13 +168,13 @@ typedef JKQTPCoordinateAxes JKQTPCoordinateAxisRef;
|
||||
unit than \f$ pi \f$ ,i.e.:
|
||||
|
||||
\image html axisstyle/axis_unit_scaling_none.png "no axis scaling (default case)"
|
||||
\image html axisstyle/axis_unit_scaling_pi.png "pi-axis scaling (default case)"
|
||||
\image html axisstyle/axis_unit_scaling_pi.png "pi-axis scaling"
|
||||
|
||||
You can use these methods to set such a factor:
|
||||
- setTickUnitFactor() for the actual factor and setTickUnitName() for a name, added to the tick label
|
||||
- setTickUnit() sets factor and name in one call
|
||||
- setTickUnitPi() shortcut to set pi-scaling
|
||||
- resetTickUnit() resets to no-scaling (default case)
|
||||
- JKQTPCoordinateAxis::setTickUnitFactor() for the actual factor and setTickUnitName() for a name, added to the tick label
|
||||
- JKQTPCoordinateAxis::setTickUnit() sets factor and name in one call
|
||||
- JKQTPCoordinateAxis::setTickUnitPi() shortcut to set pi-scaling
|
||||
- JKQTPCoordinateAxis::resetTickUnit() resets to no-scaling (default case)
|
||||
.
|
||||
|
||||
*/
|
||||
|
@ -39,26 +39,43 @@ class JKQTMathText;
|
||||
/*! \brief base class for drawing a key (or legend)
|
||||
\ingroup jkqtpbaseplotter_elements
|
||||
|
||||
This class immplements the basic layouting and drawing of a key/legend:
|
||||
The class JKQTPBaseKey implements the basic layouting and drawing of a key/legend. The basic style properties are defined in JKQTPKeyStyle.
|
||||
|
||||
The following image shows, which properties of the key may be altered with the style:
|
||||
|
||||
\image html plot_key.png
|
||||
|
||||
\section JKQTPBaseKey_Usage 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.
|
||||
|
||||
|
||||
|
||||
\section JKQTPBaseKey_ImplementationDetails Implementation Details
|
||||
|
||||
It relies on these protected virtual functions to determine the contents of the legend items:
|
||||
- getEntryCount()
|
||||
- getEntryTextExtent()
|
||||
- getEntryText()
|
||||
- drawEntrySample()
|
||||
- JKQTPBaseKey::getEntryCount()
|
||||
- JKQTPBaseKey::getEntryTextExtent()
|
||||
- JKQTPBaseKey::getEntryText()
|
||||
- JKQTPBaseKey::drawEntrySample()
|
||||
.
|
||||
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:
|
||||
- drawKey()
|
||||
- getLayout()
|
||||
- modifySize()
|
||||
- JKQTPBaseKey::drawKey()
|
||||
- JKQTPBaseKey::getLayout()
|
||||
- JKQTPBaseKey::modifySize()
|
||||
.
|
||||
|
||||
\see JKQTPKeyStyle
|
||||
\see JKQTPKeyStyle, JKQTPMainKey
|
||||
|
||||
*/
|
||||
class JKQTPLOTTER_LIB_EXPORT JKQTPBaseKey: public QObject {
|
||||
|
Loading…
Reference in New Issue
Block a user