JKQTPlotter
an extensive Qt4/Qt5 Plotter framework (including a fast variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Collaboration diagram for JKQTPlotter Styling System:

Classes

class  JKQTBasePlotterStyle
 Support Class for JKQTBasePlotter, which summarizes all proeprties that define the visual styling of a JKQTBasePlotter. More...
 
class  JKQTPCoordinateAxisStyle
 Support Class for JKQTPCoordinateAxis, which summarizes all proeprties that define the visual styling of a JKQTPCoordinateAxis. More...
 
class  JKQTPKeyStyle
 Support Class for JKQTBasePlotter, which summarizes all proeprties that define the visual styling of the key in a JKQTBasePlotter. More...
 
class  JKQTPlotterStyle
 Support Class for JKQTPlotter, which summarizes all proeprties that define the visual styling of a JKQTPlotter. More...
 

Enumerations

enum  JKQTPColorDerivationMode {
  JKQTPFFCMSameColor,
  JKQTPFFCMInvertedColor,
  JKQTPFFCMLighterColor,
  JKQTPFFCMEvenLighterColor,
  JKQTPFFCMDarkerColor,
  JKQTPFFCMEvenDarkerColor,
  JKQTPFFCMMoreTransparentColor,
  JKQTPFFCMEvenMoreTransparentColor,
  JKQTPFFCMLessTransparentColor,
  JKQTPFFCMEvenLessTransparentColor
}
 Specifies how a fill-color is derived from a given color. More...
 

Functions

JKQTPLOTTER_LIB_EXPORT QString JKQTPColorDerivationMode2String (JKQTPColorDerivationMode mode)
 convert a JKQTPColorDerivationMode to a QString More...
 
JKQTPLOTTER_LIB_EXPORT QColor JKQTPGetDerivedColor (JKQTPColorDerivationMode mode, const QColor &col)
 use a JKQTPColorDerivationMode to derive a color from col as specified More...
 
JKQTPLOTTER_LIB_EXPORT JKQTBasePlotterStyleJKQTPGetSystemDefaultBaseStyle ()
 returns the system-wide default JKQTPlotterStyle More...
 
JKQTPLOTTER_LIB_EXPORT JKQTPlotterStyleJKQTPGetSystemDefaultStyle ()
 returns the system-wide default JKQTPlotterStyle More...
 
JKQTPLOTTER_LIB_EXPORT void JKQTPSetSystemDefaultBaseStyle (JKQTBasePlotterStyle &newStyle)
 replaces the system-wide default JKQTPlotterStyle with the given newStyle More...
 
JKQTPLOTTER_LIB_EXPORT void JKQTPSetSystemDefaultStyle (JKQTPlotterStyle &newStyle)
 replaces the system-wide default JKQTPlotterStyle with the given newStyle More...
 
QColor QColorWithAlpha (const QColor &color, int alpha)
 construct a QColor, based on the given color, but with alpha set to the specified value alpha More...
 
QColor QColorWithAlphaF (const QColor &color, qreal alphaF)
 construct a QColor, based on the given color, but with alpha set to the specified value alphaF More...
 
JKQTPLOTTER_LIB_EXPORT JKQTPColorDerivationMode String2JKQTPColorDerivationMode (const QString &mode)
 convert a QString (created by JKQTPColorDerivationMode2String() ) to JKQTPColorDerivationMode More...
 

Detailed Description

JKQTPlotter (and JKQTBasePlotter) offer a styling system, which allows to easily define and transfer plot styling from one object to another. The system is based on a hirarchy of structs, which summarize properties, describing how a plot looks in general. The classes contained in this system are:

In addition there are static methods that allow to manage a system-wide (actually program-instance wide) style that is applied to any new instance of JKQTPlotter and JKQTBasePlotter on construction:

You can e.g. use these general methods to alter the styles for all JKQTPlotter instances, created in the future:

// load the system-wide default settings from an INI-file:
QSettings plotSettings("JKQTPlotterSettings.ini", QSettings::IniFormat);;
// alter a system-wide default setting by hand (here: set color of zooming rect to red)
JKQTPGetSystemDefaultStyle().userActionColor=QColor("red");

Several pre-made styles are available in the JKQTPlotter repository (https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/). These are also linked into the JKQTPlotter library as Qt ressource into the subdirectory :/JKQTPlotter/styles/ . You can use them as follows:

QSettings plotSettings(":/JKQTPlotter/styles/blackandwhite.ini", QSettings::IniFormat);;

Here is a table with all available ready-made styles:

Style-file Screenshot
The Default Style
:/JKQTPlotter/styles/simple_gridandticks.ini
:/JKQTPlotter/styles/simple_axesoffset.ini
:/JKQTPlotter/styles/simple_axesoffset_plotbox.ini
:/JKQTPlotter/styles/dark.ini
:/JKQTPlotter/styles/blueprint.ini
:/JKQTPlotter/styles/blackandwhite.ini
See also
For a detailed example, see Tutorial (JKQTPlotter): Styling a JKQtPlotter

Enumeration Type Documentation

◆ JKQTPColorDerivationMode

Specifies how a fill-color is derived from a given color.

Enumerator
JKQTPFFCMSameColor 

fill with the same color

JKQTPFFCMInvertedColor 

fill with the inverted color

JKQTPFFCMLighterColor 

fill with the a lighter color

JKQTPFFCMEvenLighterColor 

fill with the an even lighter color than JKQTPFFCMLighterColor

JKQTPFFCMDarkerColor 

fill with the a darker color

JKQTPFFCMEvenDarkerColor 

fill with the an even darker color than JKQTPFFCMDarkerColor

JKQTPFFCMMoreTransparentColor 

fill with the a partly transparent color

JKQTPFFCMEvenMoreTransparentColor 

fill with the a more transparent color than JKQTPFFCMMoreTransparentColor

JKQTPFFCMLessTransparentColor 

fill with the a partly transparent color

JKQTPFFCMEvenLessTransparentColor 

fill with the a more transparent color than JKQTPFFCMLessTransparentColor

Function Documentation

◆ JKQTPColorDerivationMode2String()

JKQTPLOTTER_LIB_EXPORT QString JKQTPColorDerivationMode2String ( JKQTPColorDerivationMode  mode)

convert a JKQTPColorDerivationMode to a QString

See also
String2JKQTPColorDerivationMode(), JKQTPColorDerivationMode

◆ JKQTPGetDerivedColor()

JKQTPLOTTER_LIB_EXPORT QColor JKQTPGetDerivedColor ( JKQTPColorDerivationMode  mode,
const QColor &  col 
)

use a JKQTPColorDerivationMode to derive a color from col as specified

See also
JKQTPColorDerivationMode

◆ JKQTPGetSystemDefaultBaseStyle()

◆ JKQTPGetSystemDefaultStyle()

◆ JKQTPSetSystemDefaultBaseStyle()

JKQTPLOTTER_LIB_EXPORT void JKQTPSetSystemDefaultBaseStyle ( JKQTBasePlotterStyle newStyle)

◆ JKQTPSetSystemDefaultStyle()

JKQTPLOTTER_LIB_EXPORT void JKQTPSetSystemDefaultStyle ( JKQTPlotterStyle newStyle)

◆ QColorWithAlpha()

QColor QColorWithAlpha ( const QColor &  color,
int  alpha 
)
inline

construct a QColor, based on the given color, but with alpha set to the specified value alpha

See also
QColorWithAlphaF()

◆ QColorWithAlphaF()

QColor QColorWithAlphaF ( const QColor &  color,
qreal  alphaF 
)
inline

construct a QColor, based on the given color, but with alpha set to the specified value alphaF

See also
QColorWithAlpha()

◆ String2JKQTPColorDerivationMode()

JKQTPLOTTER_LIB_EXPORT JKQTPColorDerivationMode String2JKQTPColorDerivationMode ( const QString &  mode)

convert a QString (created by JKQTPColorDerivationMode2String() ) to JKQTPColorDerivationMode

See also
JKQTPColorDerivationMode2String(), JKQTPColorDerivationMode
JKQTBasePlotterStyle::loadSettings
void loadSettings(const QSettings &settings, const QString &group=QString("plots/"), const JKQTBasePlotterStyle &defaultStyle=JKQTBasePlotterStyle())
loads the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object
JKQTPGetSystemDefaultBaseStyle
JKQTPLOTTER_LIB_EXPORT JKQTBasePlotterStyle & JKQTPGetSystemDefaultBaseStyle()
returns the system-wide default JKQTPlotterStyle
JKQTPlotterStyle::loadSettings
void loadSettings(const QSettings &settings, const QString &group=QString("plots/"), const JKQTPlotterStyle &defaultStyle=JKQTPlotterStyle())
loads the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object
JKQTPGetSystemDefaultStyle
JKQTPLOTTER_LIB_EXPORT JKQTPlotterStyle & JKQTPGetSystemDefaultStyle()
returns the system-wide default JKQTPlotterStyle