IMPROVED/REWORKED: reworked JKQTPCADrawMode and coordinate axis drawing so the draw mide can be specified as ORed combination of flags from JKQTPCADrawModeElements, added flags to draw arrows at the end of the axis line
IMPROVED/REWORKED: coordinate axis code was refactored NEW: all elements of a coordinate axis may have their own color now
@ -114,13 +114,13 @@ if(JKQtPlotter_BUILD_TOOLS)
|
|||||||
)
|
)
|
||||||
add_dependencies(JKQTPlotter_GenerateDocImages JKQTPlotter_GenerateDocImages_listerrorindicators)
|
add_dependencies(JKQTPlotter_GenerateDocImages JKQTPlotter_GenerateDocImages_listerrorindicators)
|
||||||
|
|
||||||
add_custom_target(JKQTPlotter_GenerateDocImages_listaxislabeltype
|
add_custom_target(JKQTPlotter_GenerateDocImages_listaxisstyleprops
|
||||||
COMMENT "Building JKQTPlotter Documentation Images: listaxislabeltype"
|
COMMENT "Building JKQTPlotter Documentation Images: listaxisstyleprops"
|
||||||
COMMAND ${JKQTPlotter_GenerateDocImages_COMMAND} --listaxislabeltype --background=lightgrey --iconsize=50 --outputdir="${JKQTPlotter_GenerateDocImages_OutputDir}/"
|
COMMAND ${JKQTPlotter_GenerateDocImages_COMMAND} --listaxisstyleprops --background=lightgrey --iconsize=50 --outputdir="${JKQTPlotter_GenerateDocImages_OutputDir}/axisstyle/"
|
||||||
WORKING_DIRECTORY ${JKQtPlotter_QT_BINDIR}
|
WORKING_DIRECTORY ${JKQtPlotter_QT_BINDIR}
|
||||||
DEPENDS jkqtplotter_doc_imagegenerator
|
DEPENDS jkqtplotter_doc_imagegenerator
|
||||||
)
|
)
|
||||||
add_dependencies(JKQTPlotter_GenerateDocImages JKQTPlotter_GenerateDocImages_listaxislabeltype)
|
add_dependencies(JKQTPlotter_GenerateDocImages JKQTPlotter_GenerateDocImages_listaxisstyleprops)
|
||||||
|
|
||||||
endif(JKQtPlotter_BUILD_TOOLS)
|
endif(JKQtPlotter_BUILD_TOOLS)
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
|
|||||||
<li>REORGANIZED: separated line-graphs from jkqtpscatter.h/.cpp into jkqtplines.h/.cpp</li>
|
<li>REORGANIZED: separated line-graphs from jkqtpscatter.h/.cpp into jkqtplines.h/.cpp</li>
|
||||||
<li>IMPROVED: QT6-compatibility by removing deprecated warnings</li>
|
<li>IMPROVED: QT6-compatibility by removing deprecated warnings</li>
|
||||||
<li>IMPROVED/REWORKED: reworked JKQTPErrorPlotstyle and error indicator plotting so error-inidcators can be specified as ORed combination of flags from JKQTPErrorPlotstyleElements, added additional error indicator styles (half-bars, arrows...)</li>
|
<li>IMPROVED/REWORKED: reworked JKQTPErrorPlotstyle and error indicator plotting so error-inidcators can be specified as ORed combination of flags from JKQTPErrorPlotstyleElements, added additional error indicator styles (half-bars, arrows...)</li>
|
||||||
|
<li>IMPROVED/REWORKED: reworked JKQTPCADrawMode and coordinate axis drawing so the draw mide can be specified as ORed combination of flags from JKQTPCADrawModeElements, added flags to draw arrows at the end of the axis line</li>
|
||||||
|
<li>IMPROVED/REWORKED: coordinate axis code was refactored</li>
|
||||||
<li>NEW: JKQTPFilledCurveXGraph and JKQTPFilledCurveYGraph can now plot wiggle plots with different fill styles above and below the baseline (feature request <a href="https://github.com/jkriege2/JKQtPlotter/issues/68">#68 Wiggle Plots</a> from <a href="https://github.com/xichaoqiang">user:xichaoqiang</a> </li>
|
<li>NEW: JKQTPFilledCurveXGraph and JKQTPFilledCurveYGraph can now plot wiggle plots with different fill styles above and below the baseline (feature request <a href="https://github.com/jkriege2/JKQtPlotter/issues/68">#68 Wiggle Plots</a> from <a href="https://github.com/xichaoqiang">user:xichaoqiang</a> </li>
|
||||||
<li>NEW/BREAKING CHANGE: data tooltip can now also be shown when "just" moving the mouse (so far this was only possible when dragging the mouse with a button pressed). This also removes JKQtPlotter::getActMouseLeftAsToolTip() and adds JKQtPlotter::getActMouseMoveToolTip() instead! Also the default toolbars and context menus changed!</li>
|
<li>NEW/BREAKING CHANGE: data tooltip can now also be shown when "just" moving the mouse (so far this was only possible when dragging the mouse with a button pressed). This also removes JKQtPlotter::getActMouseLeftAsToolTip() and adds JKQtPlotter::getActMouseMoveToolTip() instead! Also the default toolbars and context menus changed!</li>
|
||||||
<li>NEW: new "seaborn" style for plots, see \ref jkqtpplotter_styling </li>
|
<li>NEW: new "seaborn" style for plots, see \ref jkqtpplotter_styling </li>
|
||||||
@ -54,6 +56,7 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
|
|||||||
<li>NEW: Added signals JKQTBasePlotter::beforeExporting()/JKQTBasePlotter::afterExporting() and JKQTBasePlotterJKQTBasePlotter:beforePrinting()/JKQTBasePlotter::afterPrinting() which allow to modify the plot just before and just after an export/print</li>
|
<li>NEW: Added signals JKQTBasePlotter::beforeExporting()/JKQTBasePlotter::afterExporting() and JKQTBasePlotterJKQTBasePlotter:beforePrinting()/JKQTBasePlotter::afterPrinting() which allow to modify the plot just before and just after an export/print</li>
|
||||||
<li>NEW: Added new JKQTPCALabelType elements (JKQTPCALTfrac...), so axis label ticks can be displayed as fractions 1/2 instead of 0.5</li>
|
<li>NEW: Added new JKQTPCALabelType elements (JKQTPCALTfrac...), so axis label ticks can be displayed as fractions 1/2 instead of 0.5</li>
|
||||||
<li>NEW: Added new JKQTPCALabelType element JKQTPCALTscientific, so axis label ticks can be displayed as numbers in scientific notation like \c 1.2E-34 </li>
|
<li>NEW: Added new JKQTPCALabelType element JKQTPCALTscientific, so axis label ticks can be displayed as numbers in scientific notation like \c 1.2E-34 </li>
|
||||||
|
<li>NEW: all elements of a coordinate axis may have their own color now </li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
|
|
||||||
<li>JKQTMathText:<ul>
|
<li>JKQTMathText:<ul>
|
||||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 155 KiB After Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.0 KiB |
BIN
doc/images/axisstyle/JKQTPCADMAxisLabel.png
Normal file
After Width: | Height: | Size: 996 B |
BIN
doc/images/axisstyle/JKQTPCADMLine.png
Normal file
After Width: | Height: | Size: 397 B |
BIN
doc/images/axisstyle/JKQTPCADMLineTicks.png
Normal file
After Width: | Height: | Size: 436 B |
BIN
doc/images/axisstyle/JKQTPCADMLineTicksTickLabels.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
doc/images/axisstyle/JKQTPCADMMaxArrow.png
Normal file
After Width: | Height: | Size: 894 B |
BIN
doc/images/axisstyle/JKQTPCADMMaxFilledArrow.png
Normal file
After Width: | Height: | Size: 778 B |
BIN
doc/images/axisstyle/JKQTPCADMMinArrow.png
Normal file
After Width: | Height: | Size: 894 B |
BIN
doc/images/axisstyle/JKQTPCADMMinFilledArrow.png
Normal file
After Width: | Height: | Size: 773 B |
BIN
doc/images/axisstyle/JKQTPCADMTickLabels.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
doc/images/axisstyle/JKQTPCADMTickLabelsAxisLabel.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
doc/images/axisstyle/JKQTPCADMTicks.png
Normal file
After Width: | Height: | Size: 429 B |
BIN
doc/images/axisstyle/JKQTPCADMTicksTickLabels.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
doc/images/axisstyle/JKQTPCADMTicksTickLabelsAxisLabel.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
doc/images/axisstyle/JKQTPCADMcomplete.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
doc/images/axisstyle/JKQTPCADMcompleteMaxArrow.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
doc/images/axisstyle/JKQTPCADMcompleteMinMaxArrow.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
doc/images/axisstyle/JKQTPCADMnone.png
Normal file
After Width: | Height: | Size: 393 B |
BIN
doc/images/axisstyle/JKQTPCALTdate.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
doc/images/axisstyle/JKQTPCALTdatetime.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
doc/images/axisstyle/JKQTPCALTdefault.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
doc/images/axisstyle/JKQTPCALTexponent.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
doc/images/axisstyle/JKQTPCALTexponentCharacter.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
doc/images/axisstyle/JKQTPCALTfrac.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
doc/images/axisstyle/JKQTPCALTintfrac.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
doc/images/axisstyle/JKQTPCALTintsfrac.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
doc/images/axisstyle/JKQTPCALTintslashfrac.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
doc/images/axisstyle/JKQTPCALTscientific.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
doc/images/axisstyle/JKQTPCALTsfrac.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
doc/images/axisstyle/JKQTPCALTslashfrac.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
doc/images/axisstyle/JKQTPCALTtime.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
@ -83,7 +83,7 @@ void drawWithDateAxis(JKQTPlotter& plot) {
|
|||||||
// set the title above the plot, use LaTeX instructions to make text bold
|
// set the title above the plot, use LaTeX instructions to make text bold
|
||||||
plot.getPlotter()->setPlotLabel("\\textbf{Weather in Gelsenkirchen, 2017-2018}");
|
plot.getPlotter()->setPlotLabel("\\textbf{Weather in Gelsenkirchen, 2017-2018}");
|
||||||
// set x-axis date-time-axis
|
// set x-axis date-time-axis
|
||||||
plot.getXAxis()->setLabelType(JKQTPCALTdatetime);
|
plot.getXAxis()->setTickLabelType(JKQTPCALTdatetime);
|
||||||
plot.getXAxis()->setAxisLabel("Date");
|
plot.getXAxis()->setAxisLabel("Date");
|
||||||
// set format string for date axis (e.g. Jan '18), see Documentation of QDateTime::toString()
|
// set format string for date axis (e.g. Jan '18), see Documentation of QDateTime::toString()
|
||||||
plot.getXAxis()->setTickDateTimeFormat("MMM ''yy");
|
plot.getXAxis()->setTickDateTimeFormat("MMM ''yy");
|
||||||
@ -150,7 +150,7 @@ void drawWithTimeAxis(JKQTPlotter& plot) {
|
|||||||
// set the title above the plot, use LaTeX instructions to make text bold
|
// set the title above the plot, use LaTeX instructions to make text bold
|
||||||
plot.getPlotter()->setPlotLabel("\\textbf{Weather in Heidelberg, 14^{th} Oct 2018}");
|
plot.getPlotter()->setPlotLabel("\\textbf{Weather in Heidelberg, 14^{th} Oct 2018}");
|
||||||
// set x-axis date-time-axis
|
// set x-axis date-time-axis
|
||||||
plot.getXAxis()->setLabelType(JKQTPCALTtime);
|
plot.getXAxis()->setTickLabelType(JKQTPCALTtime);
|
||||||
plot.getXAxis()->setAxisLabel("Time of Day");
|
plot.getXAxis()->setAxisLabel("Time of Day");
|
||||||
// set format string for time axis with 24-hour and minute only,
|
// set format string for time axis with 24-hour and minute only,
|
||||||
// see QDateTime::toString() documentation for details on format strings
|
// see QDateTime::toString() documentation for details on format strings
|
||||||
|
@ -22,7 +22,7 @@ TestWidgetBarcharts::TestWidgetBarcharts(QWidget *parent) :
|
|||||||
plotBarchart->getPlotter()->setPlotLabel(tr("\\textbf{bar charts}"));
|
plotBarchart->getPlotter()->setPlotLabel(tr("\\textbf{bar charts}"));
|
||||||
plotBarchart->setObjectName("plotBarchart");
|
plotBarchart->setObjectName("plotBarchart");
|
||||||
plotBarchart->getPlotter()->setUserSettigsFilename(QApplication::applicationDirPath()+"/usersettings.ini", "plot_peaks/");
|
plotBarchart->getPlotter()->setUserSettigsFilename(QApplication::applicationDirPath()+"/usersettings.ini", "plot_peaks/");
|
||||||
plotBarchart->getPlotter()->getXAxis()->setLabelType(JKQTPCALTdate);
|
plotBarchart->getPlotter()->getXAxis()->setTickLabelType(JKQTPCALTdate);
|
||||||
plotBarchart->getPlotter()->getXAxis()->setTickDateFormat("dd. MMM yyyy");
|
plotBarchart->getPlotter()->getXAxis()->setTickDateFormat("dd. MMM yyyy");
|
||||||
|
|
||||||
barchartLayout->addWidget(plotBarchart);
|
barchartLayout->addWidget(plotBarchart);
|
||||||
|
@ -86,7 +86,7 @@ int main(int argc, char* argv[])
|
|||||||
plot.getYAxis()->setDrawMinorGrid(true);
|
plot.getYAxis()->setDrawMinorGrid(true);
|
||||||
// usually axis ticks are shown as numbers 0.01, 0.1, 1, 10, ... You can also force the scientific
|
// usually axis ticks are shown as numbers 0.01, 0.1, 1, 10, ... You can also force the scientific
|
||||||
// power-of-10 notation, using:
|
// power-of-10 notation, using:
|
||||||
plot.getYAxis()->setLabelType(JKQTPCALTexponent);
|
plot.getYAxis()->setTickLabelType(JKQTPCALTexponent);
|
||||||
// the number of digits in JKQTPCALTexponent determines which labels are drawn in standard-notation,
|
// the number of digits in JKQTPCALTexponent determines which labels are drawn in standard-notation,
|
||||||
// as compared to power-notation (e.g. if set to 1, the labels 0.1=10^{-1}, 1, 10 are shown in
|
// as compared to power-notation (e.g. if set to 1, the labels 0.1=10^{-1}, 1, 10 are shown in
|
||||||
// standard notation, the rest in power-notation. This tweak improves readability)
|
// standard notation, the rest in power-notation. This tweak improves readability)
|
||||||
|
@ -484,8 +484,7 @@ void JKQTPStylePlainTextEdit::contextMenuEvent(QContextMenuEvent *event)
|
|||||||
submenu->setEnabled(true);
|
submenu->setEnabled(true);
|
||||||
QAction* act;
|
QAction* act;
|
||||||
JKQTPCADrawMode st;
|
JKQTPCADrawMode st;
|
||||||
for (int i=0; i<=static_cast<int>(JKQTPCADMmax); i++) {
|
for (const JKQTPCADrawMode st : {JKQTPCADMnone,JKQTPCADMcomplete,JKQTPCADMcompleteMaxArrow,JKQTPCADMcompleteMinMaxArrow,JKQTPCADMLine,JKQTPCADMTicks,JKQTPCADMTickLabels,JKQTPCADMAxisLabel,JKQTPCADMLineTicksTickLabels,JKQTPCADMLineTicks,JKQTPCADMTicksTickLabelsAxisLabel,JKQTPCADMTicksTickLabels,JKQTPCADMTickLabelsAxisLabel}) {
|
||||||
st=static_cast<JKQTPCADrawMode>(i);
|
|
||||||
act=new QAction(JKQTPCADrawMode2String(st));
|
act=new QAction(JKQTPCADrawMode2String(st));
|
||||||
connect(act, &QAction::triggered, std::bind(std::mem_fn(&JKQTPStylePlainTextEdit::changeCurrentLineValueTo), this, act->text()));
|
connect(act, &QAction::triggered, std::bind(std::mem_fn(&JKQTPStylePlainTextEdit::changeCurrentLineValueTo), this, act->text()));
|
||||||
submenu->addAction(act);
|
submenu->addAction(act);
|
||||||
|
@ -311,7 +311,10 @@ JKQTCOMMON_LIB_EXPORT void JKQTPPlotSymbol(QPaintDevice& paintDevice, double x,
|
|||||||
*
|
*
|
||||||
* \image html geo_arrow_tipsatlineend.png
|
* \image html geo_arrow_tipsatlineend.png
|
||||||
*
|
*
|
||||||
* \see \ref JKQTPlotterGeometricArrows and \ref JKQTPlotterGeometricGraphs
|
*
|
||||||
|
* \see JKQTPPlotLineDecorator(), JKQTPPlotDecoratedLine(), JKQTPLineDecoratorStyle, JKQTPLineDecoratorStyleCalcDecoratorSize()
|
||||||
|
*
|
||||||
|
* \see \ref JKQTPlotterGeometricArrows and \ref JKQTPlotterGeometricGraphs for usage examples.
|
||||||
*/
|
*/
|
||||||
enum JKQTPLineDecoratorStyle {
|
enum JKQTPLineDecoratorStyle {
|
||||||
JKQTPNoDecorator=0, /*!< \brief no decorator, i.e. a simple line-end \image html linedecorators/none.png */
|
JKQTPNoDecorator=0, /*!< \brief no decorator, i.e. a simple line-end \image html linedecorators/none.png */
|
||||||
@ -368,8 +371,10 @@ JKQTCOMMON_LIB_EXPORT JKQTPLineDecoratorStyle String2JKQTPLineDecoratorStyle(con
|
|||||||
\param y y-coordinate of the decorator tip
|
\param y y-coordinate of the decorator tip
|
||||||
\param angle_rad angle of the line pointing to (x,y), given in radians, 0rad points to the right, >0rad is a counter-clockwise rotation, as calculated by atan2() from dx, dy of a line!
|
\param angle_rad angle of the line pointing to (x,y), given in radians, 0rad points to the right, >0rad is a counter-clockwise rotation, as calculated by atan2() from dx, dy of a line!
|
||||||
\param style type of the decorator to plot, see JKQTPLineDecoratorStyle
|
\param style type of the decorator to plot, see JKQTPLineDecoratorStyle
|
||||||
\param size size of the decorator
|
\param size size of the decorator in pixels, the decorator fills at most the space \c x...x+size and \c y-size/2...y-size/2, but may be smaller (e.g. arrows are typically less high than the full \a size pixels ).
|
||||||
\param[out] line_start optional output parameter: when drawing the line let it end here, not necessarily at (x,y)
|
\param[out] line_start optional output parameter: when drawing the line let it end here, not necessarily at (x,y)
|
||||||
|
|
||||||
|
\see JKQTPPlotLineDecorator(), JKQTPPlotDecoratedLine(), JKQTPLineDecoratorStyle, JKQTPLineDecoratorStyleCalcDecoratorSize()
|
||||||
*/
|
*/
|
||||||
template <class TPainter>
|
template <class TPainter>
|
||||||
inline void JKQTPPlotLineDecorator(TPainter& painter, double x, double y, double angle_rad, JKQTPLineDecoratorStyle style, double size, QPointF* line_start=nullptr);
|
inline void JKQTPPlotLineDecorator(TPainter& painter, double x, double y, double angle_rad, JKQTPLineDecoratorStyle style, double size, QPointF* line_start=nullptr);
|
||||||
@ -384,11 +389,19 @@ inline void JKQTPPlotLineDecorator(TPainter& painter, double x, double y, double
|
|||||||
\param size1 size of the first decorator
|
\param size1 size of the first decorator
|
||||||
\param style2 type of the second decorator to plot, see JKQTPLineDecoratorStyle
|
\param style2 type of the second decorator to plot, see JKQTPLineDecoratorStyle
|
||||||
\param size2 size of the second decorator
|
\param size2 size of the second decorator
|
||||||
|
|
||||||
|
\note a decorator fills at most the space \c x...x+size and \c y-size/2...y-size/2 (where \c size is \a size1 or \a size2), but may be smaller (e.g. arrows are typically less high than the full \c size pixels ).
|
||||||
|
|
||||||
|
\see JKQTPPlotLineDecorator(), JKQTPPlotDecoratedLine(), JKQTPLineDecoratorStyle, JKQTPLineDecoratorStyleCalcDecoratorSize()
|
||||||
*/
|
*/
|
||||||
template <class TPainter>
|
template <class TPainter>
|
||||||
inline void JKQTPPlotDecoratedLine(TPainter& painter, const QLineF& l, JKQTPLineDecoratorStyle style1, double size1, JKQTPLineDecoratorStyle style2, double size2);
|
inline void JKQTPPlotDecoratedLine(TPainter& painter, const QLineF& l, JKQTPLineDecoratorStyle style1, double size1, JKQTPLineDecoratorStyle style2, double size2);
|
||||||
|
|
||||||
/** \brief calculates the tail decorator size from the line width \a line_width, using decoratorSizeFactor and a non-linear scaling function that levels off towards small \a line_width and increases sub-linearly for large ones, so the arrow heads to not grow too much */
|
/*! \brief calculates the tail decorator size from the line width \a line_width, using decoratorSizeFactor and a non-linear scaling function that levels off towards small \a line_width and increases sub-linearly for large ones, so the arrow heads to not grow too much
|
||||||
|
\ingroup jkqtptools_drawing
|
||||||
|
|
||||||
|
\see JKQTPPlotLineDecorator(), JKQTPPlotDecoratedLine(), JKQTPLineDecoratorStyle, JKQTPLineDecoratorStyleCalcDecoratorSize()
|
||||||
|
*/
|
||||||
JKQTCOMMON_LIB_EXPORT double JKQTPLineDecoratorStyleCalcDecoratorSize(double line_width, double decoratorSizeFactor);
|
JKQTCOMMON_LIB_EXPORT double JKQTPLineDecoratorStyleCalcDecoratorSize(double line_width, double decoratorSizeFactor);
|
||||||
|
|
||||||
|
|
||||||
|
@ -377,6 +377,8 @@ JKQTPCADrawModeComboBox::JKQTPCADrawModeComboBox(QWidget *parent):
|
|||||||
{
|
{
|
||||||
setEditable(false);
|
setEditable(false);
|
||||||
addDrawMode(JKQTPCADMcomplete, tr("complete"), QIcon(":/JKQTPlotter/jkqtp_axis_complete.png"));
|
addDrawMode(JKQTPCADMcomplete, tr("complete"), QIcon(":/JKQTPlotter/jkqtp_axis_complete.png"));
|
||||||
|
addDrawMode(JKQTPCADMcompleteMaxArrow, tr("complete with max arrow"), QIcon(":/JKQTPlotter/jkqtp_axis_complete_maxarrow.png"));
|
||||||
|
addDrawMode(JKQTPCADMcompleteMinMaxArrow, tr("complete wih min&max arrows"), QIcon(":/JKQTPlotter/jkqtp_axis_complete_minmaxarrow.png"));
|
||||||
addDrawMode(JKQTPCADMLineTicksTickLabels, tr("line+tick+labels"), QIcon(":/JKQTPlotter/jkqtp_axis_ticksandlabels.png"));
|
addDrawMode(JKQTPCADMLineTicksTickLabels, tr("line+tick+labels"), QIcon(":/JKQTPlotter/jkqtp_axis_ticksandlabels.png"));
|
||||||
addDrawMode(JKQTPCADMLineTicks, tr("line+tick"), QIcon(":/JKQTPlotter/jkqtp_axis_ticks.png"));
|
addDrawMode(JKQTPCADMLineTicks, tr("line+tick"), QIcon(":/JKQTPlotter/jkqtp_axis_ticks.png"));
|
||||||
addDrawMode(JKQTPCADMLine, tr("line"), QIcon(":/JKQTPlotter/jkqtp_axis_line.png"));
|
addDrawMode(JKQTPCADMLine, tr("line"), QIcon(":/JKQTPlotter/jkqtp_axis_line.png"));
|
||||||
|
@ -250,7 +250,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPCoordinateAxis: public QObject {
|
|||||||
/** \copydoc userLogTickSpacing */
|
/** \copydoc userLogTickSpacing */
|
||||||
inline double getUserLogTickSpacing() const { return this->userLogTickSpacing; }
|
inline double getUserLogTickSpacing() const { return this->userLogTickSpacing; }
|
||||||
/** \copydoc JKQTPCoordinateAxisStyle::labelType */
|
/** \copydoc JKQTPCoordinateAxisStyle::labelType */
|
||||||
inline JKQTPCALabelType getLabelType() const { return this->axisStyle.labelType; }
|
inline JKQTPCALabelType getTickLabelType() const { return this->axisStyle.tickLabelType; }
|
||||||
/** \copydoc axisLabel */
|
/** \copydoc axisLabel */
|
||||||
inline QString getAxisLabel() const { return this->axisLabel; }
|
inline QString getAxisLabel() const { return this->axisLabel; }
|
||||||
/** \copydoc JKQTPCoordinateAxisStyle::labelPosition */
|
/** \copydoc JKQTPCoordinateAxisStyle::labelPosition */
|
||||||
@ -271,10 +271,22 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPCoordinateAxis: public QObject {
|
|||||||
inline unsigned int getMinorTicks() const { return this->axisStyle.minorTicks; }
|
inline unsigned int getMinorTicks() const { return this->axisStyle.minorTicks; }
|
||||||
/** \copydoc JKQTPCoordinateAxisStyle::tickOutsideLength */
|
/** \copydoc JKQTPCoordinateAxisStyle::tickOutsideLength */
|
||||||
inline double getTickOutsideLength() const { return this->axisStyle.tickOutsideLength; }
|
inline double getTickOutsideLength() const { return this->axisStyle.tickOutsideLength; }
|
||||||
|
/** \copydoc JKQTPCoordinateAxisStyle::arrowSizeFactor */
|
||||||
|
inline double getArrowSizeFactor() const { return this->axisStyle.arrowSizeFactor; }
|
||||||
/** \copydoc JKQTPCoordinateAxisStyle::minorTickOutsideLength */
|
/** \copydoc JKQTPCoordinateAxisStyle::minorTickOutsideLength */
|
||||||
inline double getMinorTickOutsideLength() const { return this->axisStyle.minorTickOutsideLength; }
|
inline double getMinorTickOutsideLength() const { return this->axisStyle.minorTickOutsideLength; }
|
||||||
/** \copydoc JKQTPCoordinateAxisStyle::axisColor */
|
/** \copydoc JKQTPCoordinateAxisStyle::axisColor */
|
||||||
inline QColor getAxisColor() const { return this->axisStyle.axisColor; }
|
inline QColor getAxisColor() const { return this->axisStyle.axisColor; }
|
||||||
|
/** \copydoc JKQTPCoordinateAxisStyle::labelColor */
|
||||||
|
inline QColor getLabelColor() const { return this->axisStyle.labelColor; }
|
||||||
|
/** \copydoc JKQTPCoordinateAxisStyle::minorTickColor */
|
||||||
|
inline QColor getMinorTickColor() const { return this->axisStyle.minorTickColor; }
|
||||||
|
/** \copydoc JKQTPCoordinateAxisStyle::minorTickLabelColor */
|
||||||
|
inline QColor getMinorTickLabelColor() const { return this->axisStyle.minorTickLabelColor; }
|
||||||
|
/** \copydoc JKQTPCoordinateAxisStyle::tickColor */
|
||||||
|
inline QColor getTickColor() const { return this->axisStyle.tickColor; }
|
||||||
|
/** \copydoc JKQTPCoordinateAxisStyle::tickLabelColor */
|
||||||
|
inline QColor getTickLabelColor() const { return this->axisStyle.tickLabelColor; }
|
||||||
/** \copydoc JKQTPCoordinateAxisStyle::showZeroAxis */
|
/** \copydoc JKQTPCoordinateAxisStyle::showZeroAxis */
|
||||||
inline bool getShowZeroAxis() const { return this->axisStyle.showZeroAxis; }
|
inline bool getShowZeroAxis() const { return this->axisStyle.showZeroAxis; }
|
||||||
/** \copydoc JKQTPGridStyle::lineColor */
|
/** \copydoc JKQTPGridStyle::lineColor */
|
||||||
@ -441,7 +453,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPCoordinateAxis: public QObject {
|
|||||||
void setUserLogTickSpacing (double __value);
|
void setUserLogTickSpacing (double __value);
|
||||||
|
|
||||||
/** \copydoc JKQTPCoordinateAxisStyle::labelType */
|
/** \copydoc JKQTPCoordinateAxisStyle::labelType */
|
||||||
void setLabelType (JKQTPCALabelType __value);
|
void setTickLabelType (JKQTPCALabelType __value);
|
||||||
|
|
||||||
/** \copydoc JKQTPCoordinateAxisStyle::tickMode */
|
/** \copydoc JKQTPCoordinateAxisStyle::tickMode */
|
||||||
void setTickMode (JKQTPLabelTickMode __value);
|
void setTickMode (JKQTPLabelTickMode __value);
|
||||||
@ -561,6 +573,18 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPCoordinateAxis: public QObject {
|
|||||||
|
|
||||||
/** \copydoc JKQTPCoordinateAxisStyle::tickLabelAngle */
|
/** \copydoc JKQTPCoordinateAxisStyle::tickLabelAngle */
|
||||||
void setTickLabelAngle(double __value);
|
void setTickLabelAngle(double __value);
|
||||||
|
/** \copydoc JKQTPCoordinateAxisStyle::arrowSizeFactor */
|
||||||
|
void setArrowSizeFactor(double f) ;
|
||||||
|
/** \copydoc JKQTPCoordinateAxisStyle::labelColor */
|
||||||
|
void setLabelColor(QColor c) ;
|
||||||
|
/** \copydoc JKQTPCoordinateAxisStyle::minorTickColor */
|
||||||
|
void setMinorTickColor(QColor c) ;
|
||||||
|
/** \copydoc JKQTPCoordinateAxisStyle::minorTickLabelColor */
|
||||||
|
void setMinorTickLabelColor(QColor c) ;
|
||||||
|
/** \copydoc JKQTPCoordinateAxisStyle::tickColor */
|
||||||
|
void setTickColor(QColor c);
|
||||||
|
/** \copydoc JKQTPCoordinateAxisStyle::tickLabelColor */
|
||||||
|
void setTickLabelColor(QColor c) ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/** \brief indicates whether one of the parameters has changed sinse the last recalculation of tickSpacing ... */
|
/** \brief indicates whether one of the parameters has changed sinse the last recalculation of tickSpacing ... */
|
||||||
@ -742,6 +766,8 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPCoordinateAxis: public QObject {
|
|||||||
/** \brief calculates the maximum width and height (returned as QSize) of all tick labels.
|
/** \brief calculates the maximum width and height (returned as QSize) of all tick labels.
|
||||||
* Ascent and descent may also be returned in the two additional pointer arguments- */
|
* Ascent and descent may also be returned in the two additional pointer arguments- */
|
||||||
QSizeF getMaxTickLabelSize(JKQTPEnhancedPainter& painter, double* ascent=nullptr, double* descent=nullptr);
|
QSizeF getMaxTickLabelSize(JKQTPEnhancedPainter& painter, double* ascent=nullptr, double* descent=nullptr);
|
||||||
|
/** \brief draw the axis line \a l (pointing from axismin to axismax) optionally decorated as specified by \a drawMode using JKQTPEnhancedPainter \a painter */
|
||||||
|
void drawAxisLine(JKQTPEnhancedPainter& painter, const QLineF& l, JKQTPCADrawMode drawMode) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -783,8 +809,36 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPVerticalAxis: public JKQTPCoordinateAxis {
|
|||||||
virtual double getParentOtheraxisOffset() const override;
|
virtual double getParentOtheraxisOffset() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void drawTickLabel1(JKQTPEnhancedPainter& painter, double xx, double yy, const QString &label, double fontSize) ;
|
/** \brief draw a tick label on the left axis 1 with text \a label (with optional rotation) at ( \a xx , \a yy ) (in pixel)
|
||||||
virtual void drawTickLabel2(JKQTPEnhancedPainter& painter, double xx, double yy, const QString &label, double fontSize) ;
|
*
|
||||||
|
* \param painter the JKQTPEnhancedPainter used for drawing
|
||||||
|
* \param xx the exact position of the tick in pixels
|
||||||
|
* \param yy the exact position of the tick in pixels
|
||||||
|
* \param labelOffset offset of the label from ( \a xx , \a yy ) in pt, this is typically equal to \c tickOuterLength+tickLabelDistance
|
||||||
|
* \param label text to display
|
||||||
|
* \param fontSize the fontSize of the label (in pt)
|
||||||
|
* \param ascentMax maximum ascent of all tick labels
|
||||||
|
* \param descentMax maximum descent of all tick labels
|
||||||
|
* \param isMinor indicates whether the axis tick is a minor tick
|
||||||
|
*/
|
||||||
|
void drawTickLabel1(JKQTPEnhancedPainter& painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, bool isMinor=false) ;
|
||||||
|
/** \brief draw a tick label on the right axis 2 with text \a label (with optional rotation) at ( \a xx , \a yy ) (in pixel)
|
||||||
|
*
|
||||||
|
* \param painter the JKQTPEnhancedPainter used for drawing
|
||||||
|
* \param xx the exact position of the tick in pixels
|
||||||
|
* \param yy the exact position of the tick in pixels
|
||||||
|
* \param labelOffset offset of the label from ( \a xx , \a yy ) in pt, this is typically equal to \c tickOuterLength+tickLabelDistance
|
||||||
|
* \param label text to display
|
||||||
|
* \param fontSize the fontSize of the label (in pt)
|
||||||
|
* \param ascentMax maximum ascent of all tick labels
|
||||||
|
* \param descentMax maximum descent of all tick labels
|
||||||
|
* \param isMinor indicates whether the axis tick is a minor tick
|
||||||
|
*/
|
||||||
|
void drawTickLabel2(JKQTPEnhancedPainter& painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, bool isMinor=false) ;
|
||||||
|
/** \brief draw the axis label using \a painter for axis 1 at \c x= \a left and \c y= \a bottom. \a labelMax is the maximum Size of all tick labels */
|
||||||
|
void drawAxisLabel1(JKQTPEnhancedPainter &painter, double left, double bottom, QSizeF labelMax);
|
||||||
|
/** \brief draw the axis label using \a painter for axis 2 at \c x= \a right and \c y= \a bottom. \a labelMax is the maximum Size of all tick labels */
|
||||||
|
void drawAxisLabel2(JKQTPEnhancedPainter &painter, double right, double bottom, QSizeF labelMax);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -871,9 +925,36 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPHorizontalAxis: public JKQTPCoordinateAxis {
|
|||||||
virtual double getParentOtheraxisOffset() const override;
|
virtual double getParentOtheraxisOffset() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
/** \brief draw a tick label on the lower axis 1 with text \a label (with optional rotation) at ( \a xx , \a yy ) (in pixel)
|
||||||
virtual void drawTickLabel1(JKQTPEnhancedPainter& painter, double xx, double yy, const QString &label, double fontSize, double ascentMax, double descentMax) ;
|
*
|
||||||
virtual void drawTickLabel2(JKQTPEnhancedPainter& painter, double xx, double yy, const QString &label, double fontSize, double ascentMax, double descentMax) ;
|
* \param painter the JKQTPEnhancedPainter used for drawing
|
||||||
|
* \param xx the exact position of the tick in pixels
|
||||||
|
* \param yy the exact position of the tick in pixels
|
||||||
|
* \param labelOffset offset of the label from ( \a xx , \a yy ) in pt, this is typically equal to \c tickOuterLength+tickLabelDistance
|
||||||
|
* \param label text to display
|
||||||
|
* \param fontSize the fontSize of the label (in pt)
|
||||||
|
* \param ascentMax maximum ascent of all tick labels
|
||||||
|
* \param descentMax maximum descent of all tick labels
|
||||||
|
* \param isMinor indicates whether the axis tick is a minor tick
|
||||||
|
*/
|
||||||
|
void drawTickLabel1(JKQTPEnhancedPainter& painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, double ascentMax, double descentMax, bool isMinor=false) ;
|
||||||
|
/** \brief draw a tick label on the upper axis 2 with text \a label (with optional rotation) at ( \a xx , \a yy ) (in pixel)
|
||||||
|
*
|
||||||
|
* \param painter the JKQTPEnhancedPainter used for drawing
|
||||||
|
* \param xx the exact position of the tick in pixels
|
||||||
|
* \param yy the exact position of the tick in pixels
|
||||||
|
* \param labelOffset offset of the label from ( \a xx , \a yy ) in pt, this is typically equal to \c tickOuterLength+tickLabelDistance
|
||||||
|
* \param label text to display
|
||||||
|
* \param fontSize the fontSize of the label (in pt)
|
||||||
|
* \param ascentMax maximum ascent of all tick labels
|
||||||
|
* \param descentMax maximum descent of all tick labels
|
||||||
|
* \param isMinor indicates whether the axis tick is a minor tick
|
||||||
|
*/
|
||||||
|
void drawTickLabel2(JKQTPEnhancedPainter& painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, double ascentMax, double descentMax, bool isMinor=false) ;
|
||||||
|
/** \brief draw the axis label using \a painter for axis 1 at \c x= \a left and \c y= \a bottom. \a labelMax is the maximum Size of all tick labels */
|
||||||
|
void drawAxisLabel1(JKQTPEnhancedPainter &painter, double left, double bottom, QSizeF labelMax);
|
||||||
|
/** \brief draw the axis label using \a painter for axis 2 at \c x= \a left and \c y= \a top. \a labelMax is the maximum Size of all tick labels */
|
||||||
|
void drawAxisLabel2(JKQTPEnhancedPainter &painter, double left, double top, QSizeF labelMax);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ JKQTPCoordinateAxisStyle::JKQTPCoordinateAxisStyle():
|
|||||||
labelDigits(3),
|
labelDigits(3),
|
||||||
autoLabelDigits(true),
|
autoLabelDigits(true),
|
||||||
minorTickLabelsEnabled(false),
|
minorTickLabelsEnabled(false),
|
||||||
labelType(JKQTPCALTexponent),
|
tickLabelType(JKQTPCALTexponent),
|
||||||
tickMode(JKQTPLTMLinOrPower),
|
tickMode(JKQTPLTMLinOrPower),
|
||||||
labelPosition(JKQTPLabelCenter),
|
labelPosition(JKQTPLabelCenter),
|
||||||
labelFontSize(10),
|
labelFontSize(10),
|
||||||
@ -43,9 +43,14 @@ JKQTPCoordinateAxisStyle::JKQTPCoordinateAxisStyle():
|
|||||||
minorTickLabelFullNumber(true),
|
minorTickLabelFullNumber(true),
|
||||||
drawMode1(JKQTPCADMcomplete),
|
drawMode1(JKQTPCADMcomplete),
|
||||||
drawMode2(JKQTPCADMLineTicks),
|
drawMode2(JKQTPCADMLineTicks),
|
||||||
|
minorTickColor(QColor("black")),
|
||||||
|
minorTickLabelColor(QColor("black")),
|
||||||
minorTickWidth(1),
|
minorTickWidth(1),
|
||||||
|
tickColor(QColor("black")),
|
||||||
|
tickLabelColor(QColor("black")),
|
||||||
tickWidth(1.5),
|
tickWidth(1.5),
|
||||||
lineWidth(1.5),
|
lineWidth(1.5),
|
||||||
|
arrowSizeFactor(8),
|
||||||
lineWidthZeroAxis(1.5),
|
lineWidthZeroAxis(1.5),
|
||||||
tickTimeFormat(QLocale().timeFormat(QLocale::NarrowFormat)),
|
tickTimeFormat(QLocale().timeFormat(QLocale::NarrowFormat)),
|
||||||
tickDateFormat(QLocale().dateFormat(QLocale::NarrowFormat)),
|
tickDateFormat(QLocale().dateFormat(QLocale::NarrowFormat)),
|
||||||
@ -57,7 +62,8 @@ JKQTPCoordinateAxisStyle::JKQTPCoordinateAxisStyle():
|
|||||||
tickInsideLength(3),
|
tickInsideLength(3),
|
||||||
minorTickInsideLength(1.5),
|
minorTickInsideLength(1.5),
|
||||||
axisColor(QColor("black")),
|
axisColor(QColor("black")),
|
||||||
tickLabelDistance(3),
|
labelColor(QColor("black")),
|
||||||
|
tickLabelDistance(4),
|
||||||
labelDistance(5),
|
labelDistance(5),
|
||||||
tickLabelAngle(0),
|
tickLabelAngle(0),
|
||||||
majorGridStyle(true),
|
majorGridStyle(true),
|
||||||
@ -85,6 +91,7 @@ void JKQTPCoordinateAxisStyle::loadSettings(const QSettings &settings, const QSt
|
|||||||
minorTickWidth = settings.value(group+"minor_tick/width", defaultStyle.minorTickWidth).toDouble();
|
minorTickWidth = settings.value(group+"minor_tick/width", defaultStyle.minorTickWidth).toDouble();
|
||||||
tickWidth = settings.value(group+"ticks/width", defaultStyle.tickWidth).toDouble();
|
tickWidth = settings.value(group+"ticks/width", defaultStyle.tickWidth).toDouble();
|
||||||
lineWidth = settings.value(group+"line_width", defaultStyle.lineWidth).toDouble();
|
lineWidth = settings.value(group+"line_width", defaultStyle.lineWidth).toDouble();
|
||||||
|
arrowSizeFactor = settings.value(group+"arrow_size_factor", defaultStyle.arrowSizeFactor).toDouble();
|
||||||
lineWidthZeroAxis = settings.value(group+"zero_line/line_width", defaultStyle.lineWidthZeroAxis).toDouble();
|
lineWidthZeroAxis = settings.value(group+"zero_line/line_width", defaultStyle.lineWidthZeroAxis).toDouble();
|
||||||
labelFontSize = settings.value(group+"axis_label/font_size", defaultStyle.labelFontSize).toDouble();
|
labelFontSize = settings.value(group+"axis_label/font_size", defaultStyle.labelFontSize).toDouble();
|
||||||
tickLabelFontSize = settings.value(group+"ticks/label_font_size", defaultStyle.tickLabelFontSize).toDouble();
|
tickLabelFontSize = settings.value(group+"ticks/label_font_size", defaultStyle.tickLabelFontSize).toDouble();
|
||||||
@ -102,8 +109,13 @@ void JKQTPCoordinateAxisStyle::loadSettings(const QSettings &settings, const QSt
|
|||||||
tickLabelDistance = settings.value(group+"ticks/label_distance", defaultStyle.tickLabelDistance).toDouble();
|
tickLabelDistance = settings.value(group+"ticks/label_distance", defaultStyle.tickLabelDistance).toDouble();
|
||||||
labelDistance = settings.value(group+"axis_label/distance", defaultStyle.labelDistance).toDouble();
|
labelDistance = settings.value(group+"axis_label/distance", defaultStyle.labelDistance).toDouble();
|
||||||
labelPosition=String2JKQTPLabelPosition(settings.value(group+"axis_label/position", JKQTPLabelPosition2String(labelPosition)).toString());
|
labelPosition=String2JKQTPLabelPosition(settings.value(group+"axis_label/position", JKQTPLabelPosition2String(labelPosition)).toString());
|
||||||
labelType=String2JKQTPCALabelType(settings.value(group+"axis_label/type", JKQTPCALabelType2String(labelType)).toString());
|
tickLabelType=String2JKQTPCALabelType(settings.value(group+"ticks/type", JKQTPCALabelType2String(tickLabelType)).toString());
|
||||||
|
labelColor=jkqtp_String2QColor(settings.value(group+"axis_label/color", jkqtp_QColor2String(labelColor)).toString());
|
||||||
axisColor=jkqtp_String2QColor(settings.value(group+"color", jkqtp_QColor2String(axisColor)).toString());
|
axisColor=jkqtp_String2QColor(settings.value(group+"color", jkqtp_QColor2String(axisColor)).toString());
|
||||||
|
tickColor=jkqtp_String2QColor(settings.value(group+"ticks/color", jkqtp_QColor2String(tickColor)).toString());
|
||||||
|
minorTickColor=jkqtp_String2QColor(settings.value(group+"minor_tick/color", jkqtp_QColor2String(minorTickColor)).toString());
|
||||||
|
tickLabelColor=jkqtp_String2QColor(settings.value(group+"ticks/label_color", jkqtp_QColor2String(tickLabelColor)).toString());
|
||||||
|
minorTickLabelColor=jkqtp_String2QColor(settings.value(group+"minor_tick/label_color", jkqtp_QColor2String(minorTickLabelColor)).toString());
|
||||||
drawMode1=String2JKQTPCADrawMode(settings.value(group+"draw_mode1", JKQTPCADrawMode2String(drawMode1)).toString());
|
drawMode1=String2JKQTPCADrawMode(settings.value(group+"draw_mode1", JKQTPCADrawMode2String(drawMode1)).toString());
|
||||||
drawMode2=String2JKQTPCADrawMode(settings.value(group+"draw_mode2", JKQTPCADrawMode2String(drawMode2)).toString());
|
drawMode2=String2JKQTPCADrawMode(settings.value(group+"draw_mode2", JKQTPCADrawMode2String(drawMode2)).toString());
|
||||||
tickMode=String2JKQTPLabelTickMode(settings.value(group+"ticks/mode", JKQTPLabelTickMode2String(tickMode)).toString());
|
tickMode=String2JKQTPLabelTickMode(settings.value(group+"ticks/mode", JKQTPLabelTickMode2String(tickMode)).toString());
|
||||||
@ -120,28 +132,34 @@ void JKQTPCoordinateAxisStyle::saveSettings(QSettings &settings, const QString &
|
|||||||
settings.setValue(group+"draw_mode1", JKQTPCADrawMode2String(drawMode1));
|
settings.setValue(group+"draw_mode1", JKQTPCADrawMode2String(drawMode1));
|
||||||
settings.setValue(group+"draw_mode2", JKQTPCADrawMode2String(drawMode2));
|
settings.setValue(group+"draw_mode2", JKQTPCADrawMode2String(drawMode2));
|
||||||
settings.setValue(group+"line_width", lineWidth);
|
settings.setValue(group+"line_width", lineWidth);
|
||||||
|
settings.setValue(group+"arrow_size_factor", arrowSizeFactor);
|
||||||
settings.setValue(group+"axis_lines_offset", axisLineOffset);
|
settings.setValue(group+"axis_lines_offset", axisLineOffset);
|
||||||
settings.setValue(group+"min_ticks", minTicks);
|
settings.setValue(group+"min_ticks", minTicks);
|
||||||
settings.setValue(group+"axis_label/distance", labelDistance);
|
settings.setValue(group+"axis_label/distance", labelDistance);
|
||||||
settings.setValue(group+"axis_label/font_size", labelFontSize);
|
settings.setValue(group+"axis_label/font_size", labelFontSize);
|
||||||
|
settings.setValue(group+"axis_label/color", jkqtp_QColor2String(labelColor));
|
||||||
settings.setValue(group+"axis_label/position", JKQTPLabelPosition2String(labelPosition));
|
settings.setValue(group+"axis_label/position", JKQTPLabelPosition2String(labelPosition));
|
||||||
settings.setValue(group+"axis_label/type", JKQTPCALabelType2String(labelType));
|
|
||||||
settings.setValue(group+"minor_tick/labels_enabled", minorTickLabelsEnabled);
|
settings.setValue(group+"minor_tick/labels_enabled", minorTickLabelsEnabled);
|
||||||
settings.setValue(group+"minor_tick/inside_length", minorTickInsideLength);
|
settings.setValue(group+"minor_tick/inside_length", minorTickInsideLength);
|
||||||
settings.setValue(group+"minor_tick/label_font_size", minorTickLabelFontSize);
|
settings.setValue(group+"minor_tick/label_font_size", minorTickLabelFontSize);
|
||||||
settings.setValue(group+"minor_tick/label_full_number", minorTickLabelFullNumber);
|
settings.setValue(group+"minor_tick/label_full_number", minorTickLabelFullNumber);
|
||||||
|
settings.setValue(group+"minor_tick/label_color", jkqtp_QColor2String(minorTickLabelColor));
|
||||||
settings.setValue(group+"minor_tick/outside_length", minorTickOutsideLength);
|
settings.setValue(group+"minor_tick/outside_length", minorTickOutsideLength);
|
||||||
settings.setValue(group+"minor_tick/width", minorTickWidth);
|
settings.setValue(group+"minor_tick/width", minorTickWidth);
|
||||||
settings.setValue(group+"minor_tick/count", minorTicks);
|
settings.setValue(group+"minor_tick/count", minorTicks);
|
||||||
|
settings.setValue(group+"minor_tick/color", jkqtp_QColor2String(minorTickColor));
|
||||||
|
settings.setValue(group+"ticks/type", JKQTPCALabelType2String(tickLabelType));
|
||||||
settings.setValue(group+"ticks/date_format", tickDateFormat);
|
settings.setValue(group+"ticks/date_format", tickDateFormat);
|
||||||
settings.setValue(group+"ticks/datetime_format", tickDateTimeFormat);
|
settings.setValue(group+"ticks/datetime_format", tickDateTimeFormat);
|
||||||
settings.setValue(group+"ticks/inside_length", tickInsideLength);
|
settings.setValue(group+"ticks/inside_length", tickInsideLength);
|
||||||
settings.setValue(group+"ticks/label_distance", tickLabelDistance);
|
settings.setValue(group+"ticks/label_distance", tickLabelDistance);
|
||||||
settings.setValue(group+"ticks/label_font_size", tickLabelFontSize);
|
settings.setValue(group+"ticks/label_font_size", tickLabelFontSize);
|
||||||
|
settings.setValue(group+"ticks/label_color", jkqtp_QColor2String(tickLabelColor));
|
||||||
settings.setValue(group+"ticks/mode", JKQTPLabelTickMode2String(tickMode));
|
settings.setValue(group+"ticks/mode", JKQTPLabelTickMode2String(tickMode));
|
||||||
settings.setValue(group+"ticks/outside_length", tickOutsideLength);
|
settings.setValue(group+"ticks/outside_length", tickOutsideLength);
|
||||||
settings.setValue(group+"ticks/time_format", tickTimeFormat);
|
settings.setValue(group+"ticks/time_format", tickTimeFormat);
|
||||||
settings.setValue(group+"ticks/width", tickWidth);
|
settings.setValue(group+"ticks/width", tickWidth);
|
||||||
|
settings.setValue(group+"ticks/color", jkqtp_QColor2String(tickColor));
|
||||||
settings.setValue(group+"zero_line/enabled", showZeroAxis);
|
settings.setValue(group+"zero_line/enabled", showZeroAxis);
|
||||||
settings.setValue(group+"zero_line/line_width", lineWidthZeroAxis);
|
settings.setValue(group+"zero_line/line_width", lineWidthZeroAxis);
|
||||||
settings.setValue(group+"zero_line/color", jkqtp_QColor2String(colorZeroAxis));
|
settings.setValue(group+"zero_line/color", jkqtp_QColor2String(colorZeroAxis));
|
||||||
@ -150,6 +168,45 @@ void JKQTPCoordinateAxisStyle::saveSettings(QSettings &settings, const QString &
|
|||||||
minorGridStyle.saveSettings(settings, group+"minor_grid/");
|
minorGridStyle.saveSettings(settings, group+"minor_grid/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPen JKQTPCoordinateAxisStyle::getZeroAxisPen(JKQTPEnhancedPainter& painter, JKQTBasePlotter *parent) const
|
||||||
|
{
|
||||||
|
QPen pmain(colorZeroAxis);
|
||||||
|
pmain.setWidthF(qMax(JKQTPlotterDrawingTools::ABS_MIN_LINEWIDTH, parent->pt2px(painter, lineWidthZeroAxis*parent->getLineWidthMultiplier())));
|
||||||
|
pmain.setStyle(styleZeroAxis);
|
||||||
|
pmain.setCapStyle(Qt::SquareCap);
|
||||||
|
return pmain;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPen JKQTPCoordinateAxisStyle::getAxisPen(JKQTPEnhancedPainter& painter, JKQTBasePlotter *parent) const {
|
||||||
|
QPen pmain(axisColor);
|
||||||
|
pmain.setWidthF(qMax(JKQTPlotterDrawingTools::ABS_MIN_LINEWIDTH, parent->pt2px(painter, lineWidth*parent->getLineWidthMultiplier())));
|
||||||
|
pmain.setStyle(Qt::SolidLine);
|
||||||
|
pmain.setCapStyle(Qt::SquareCap);
|
||||||
|
return pmain;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPen JKQTPCoordinateAxisStyle::getTickPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const {
|
||||||
|
QPen ptick=getAxisPen(painter, parent);
|
||||||
|
ptick.setColor(tickColor);
|
||||||
|
ptick.setWidthF(qMax(JKQTPlotterDrawingTools::ABS_MIN_LINEWIDTH, parent->pt2px(painter, tickWidth*parent->getLineWidthMultiplier())));
|
||||||
|
ptick.setCapStyle(Qt::FlatCap);
|
||||||
|
return ptick;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPen JKQTPCoordinateAxisStyle::getMinorTickPen(JKQTPEnhancedPainter& painter, JKQTBasePlotter *parent) const {
|
||||||
|
QPen pmtick=getTickPen(painter, parent);
|
||||||
|
pmtick.setColor(minorTickColor);
|
||||||
|
pmtick.setWidthF(qMax(JKQTPlotterDrawingTools::ABS_MIN_LINEWIDTH, parent->pt2px(painter, minorTickWidth*parent->getLineWidthMultiplier())));
|
||||||
|
pmtick.setCapStyle(Qt::FlatCap);
|
||||||
|
return pmtick;
|
||||||
|
}
|
||||||
|
|
||||||
|
double JKQTPCoordinateAxisStyle::getArrowSize(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
|
||||||
|
{
|
||||||
|
const QPen paxis=getAxisPen(painter, parent);
|
||||||
|
return JKQTPLineDecoratorStyleCalcDecoratorSize(paxis.widthF(), arrowSizeFactor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
JKQTPColorbarCoordinateAxisStyle::JKQTPColorbarCoordinateAxisStyle():
|
JKQTPColorbarCoordinateAxisStyle::JKQTPColorbarCoordinateAxisStyle():
|
||||||
JKQTPCoordinateAxisStyle()
|
JKQTPCoordinateAxisStyle()
|
||||||
|
@ -107,7 +107,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPCoordinateAxisStyle {
|
|||||||
/** \brief if \c true, the plotter displays minor axis labels as number between 1 and 10 in some cases */
|
/** \brief if \c true, the plotter displays minor axis labels as number between 1 and 10 in some cases */
|
||||||
bool minorTickLabelsEnabled;
|
bool minorTickLabelsEnabled;
|
||||||
/** \brief indicates how to draw the labels */
|
/** \brief indicates how to draw the labels */
|
||||||
JKQTPCALabelType labelType;
|
JKQTPCALabelType tickLabelType;
|
||||||
|
|
||||||
/** \brief mode of the major ticks */
|
/** \brief mode of the major ticks */
|
||||||
JKQTPLabelTickMode tickMode;
|
JKQTPLabelTickMode tickMode;
|
||||||
@ -116,6 +116,8 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPCoordinateAxisStyle {
|
|||||||
JKQTPLabelPosition labelPosition;
|
JKQTPLabelPosition labelPosition;
|
||||||
/** \brief fontsize of the axis labels */
|
/** \brief fontsize of the axis labels */
|
||||||
double labelFontSize;
|
double labelFontSize;
|
||||||
|
/** \brief color of the axis label */
|
||||||
|
QColor labelColor;
|
||||||
/** \brief fontsize of the axis tick labels */
|
/** \brief fontsize of the axis tick labels */
|
||||||
double tickLabelFontSize;
|
double tickLabelFontSize;
|
||||||
/** \brief fontsize of the minor axis tick labels */
|
/** \brief fontsize of the minor axis tick labels */
|
||||||
@ -130,12 +132,22 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPCoordinateAxisStyle {
|
|||||||
JKQTPCADrawMode drawMode1;
|
JKQTPCADrawMode drawMode1;
|
||||||
/** \brief draw mode of the secondary (right/top) axis */
|
/** \brief draw mode of the secondary (right/top) axis */
|
||||||
JKQTPCADrawMode drawMode2;
|
JKQTPCADrawMode drawMode2;
|
||||||
|
/** \brief color of minor ticks */
|
||||||
|
QColor minorTickColor;
|
||||||
|
/** \brief color of minor tick labels */
|
||||||
|
QColor minorTickLabelColor;
|
||||||
/** \brief line width of minor ticks in pt */
|
/** \brief line width of minor ticks in pt */
|
||||||
double minorTickWidth;
|
double minorTickWidth;
|
||||||
|
/** \brief color of axis ticks */
|
||||||
|
QColor tickColor;
|
||||||
|
/** \brief color of axis tick labels */
|
||||||
|
QColor tickLabelColor;
|
||||||
/** \brief line width of ticks in pt */
|
/** \brief line width of ticks in pt */
|
||||||
double tickWidth;
|
double tickWidth;
|
||||||
/** \brief line width of axis in pt */
|
/** \brief line width of axis in pt */
|
||||||
double lineWidth;
|
double lineWidth;
|
||||||
|
/** \brief factor used to calculate the size of line arrows */
|
||||||
|
double arrowSizeFactor;
|
||||||
/** \brief line width of 0-line in pt */
|
/** \brief line width of 0-line in pt */
|
||||||
double lineWidthZeroAxis;
|
double lineWidthZeroAxis;
|
||||||
|
|
||||||
@ -184,6 +196,18 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPCoordinateAxisStyle {
|
|||||||
Qt::PenStyle styleZeroAxis;
|
Qt::PenStyle styleZeroAxis;
|
||||||
/** \brief if non-zero, the line of the coordinate axis is moved outside the plot by this amount [pt]. This does not apply to the zero-axis! */
|
/** \brief if non-zero, the line of the coordinate axis is moved outside the plot by this amount [pt]. This does not apply to the zero-axis! */
|
||||||
double axisLineOffset;
|
double axisLineOffset;
|
||||||
|
|
||||||
|
|
||||||
|
/** \brief returns a QPen that can be used for drawing zero axis lines */
|
||||||
|
QPen getZeroAxisPen(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent) const;
|
||||||
|
/** \brief returns a QPen that can be used for drawing axis lines */
|
||||||
|
QPen getAxisPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
|
||||||
|
/** \brief returns a QPen that can be used for drawing axis tick lines */
|
||||||
|
QPen getTickPen(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent) const;
|
||||||
|
/** \brief returns a QPen that can be used for drawing minor axis tick lines */
|
||||||
|
QPen getMinorTickPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
|
||||||
|
/** \brief calculates the size of an arrow in pixels */
|
||||||
|
double getArrowSize(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ void JKQTPColorPaletteStyleAndToolsMixin::cbDrawOutside(JKQTPEnhancedPainter& pa
|
|||||||
colorBarRightAxis->setOtherAxisWidth(cb.width());
|
colorBarRightAxis->setOtherAxisWidth(cb.width());
|
||||||
colorBarRightAxis->drawAxes(painter);
|
colorBarRightAxis->drawAxes(painter);
|
||||||
|
|
||||||
if ( JKQTPCADrawModeHasLine(colorBarRightAxis->getDrawMode1()) && JKQTPCADrawModeHasLine(colorBarRightAxis->getDrawMode2())) {
|
if ( colorBarRightAxis->getDrawMode1().testFlag(JKQTPCADMLine) && colorBarRightAxis->getDrawMode2().testFlag(JKQTPCADMLine)) {
|
||||||
painter.setPen(p);
|
painter.setPen(p);
|
||||||
painter.drawLine(QLineF(cb.topLeft(), cb.topRight()));
|
painter.drawLine(QLineF(cb.topLeft(), cb.topRight()));
|
||||||
painter.drawLine(QLineF(cb.bottomLeft(), cb.bottomRight()));
|
painter.drawLine(QLineF(cb.bottomLeft(), cb.bottomRight()));
|
||||||
@ -205,7 +205,7 @@ void JKQTPColorPaletteStyleAndToolsMixin::cbDrawOutside(JKQTPEnhancedPainter& pa
|
|||||||
colorBarTopAxis->setOtherAxisWidth(cb.height());
|
colorBarTopAxis->setOtherAxisWidth(cb.height());
|
||||||
colorBarTopAxis->drawAxes(painter);
|
colorBarTopAxis->drawAxes(painter);
|
||||||
|
|
||||||
if ( JKQTPCADrawModeHasLine(colorBarTopAxis->getDrawMode1()) && JKQTPCADrawModeHasLine(colorBarTopAxis->getDrawMode2())) {
|
if ( colorBarTopAxis->getDrawMode1().testFlag(JKQTPCADMLine) && colorBarTopAxis->getDrawMode2().testFlag(JKQTPCADMLine)) {
|
||||||
painter.setPen(p);
|
painter.setPen(p);
|
||||||
painter.drawLine(QLineF(cb.topLeft(), cb.bottomLeft()));
|
painter.drawLine(QLineF(cb.topLeft(), cb.bottomLeft()));
|
||||||
painter.drawLine(QLineF(cb.topRight(), cb.bottomRight()));
|
painter.drawLine(QLineF(cb.topRight(), cb.bottomRight()));
|
||||||
@ -654,7 +654,7 @@ void JKQTPColorPaletteWithModifierStyleAndToolsMixin::cbDrawOutside(JKQTPEnhance
|
|||||||
modifierColorBarRightAxis->setOtherAxisWidth(cb.height());
|
modifierColorBarRightAxis->setOtherAxisWidth(cb.height());
|
||||||
modifierColorBarRightAxis->drawAxes(painter);
|
modifierColorBarRightAxis->drawAxes(painter);
|
||||||
} else {
|
} else {
|
||||||
if ( JKQTPCADrawModeHasLine(colorBarRightAxis->getDrawMode1()) && JKQTPCADrawModeHasLine(colorBarRightAxis->getDrawMode2())) {
|
if ( colorBarRightAxis->getDrawMode1().testFlag(JKQTPCADMLine) && colorBarRightAxis->getDrawMode2().testFlag(JKQTPCADMLine)) {
|
||||||
painter.setPen(p);
|
painter.setPen(p);
|
||||||
painter.drawLine(QLineF(cb.topLeft(), cb.topRight()));
|
painter.drawLine(QLineF(cb.topLeft(), cb.topRight()));
|
||||||
painter.drawLine(QLineF(cb.bottomLeft(), cb.bottomRight()));
|
painter.drawLine(QLineF(cb.bottomLeft(), cb.bottomRight()));
|
||||||
@ -707,7 +707,7 @@ void JKQTPColorPaletteWithModifierStyleAndToolsMixin::cbDrawOutside(JKQTPEnhance
|
|||||||
modifierColorBarTopAxis->setOtherAxisWidth(cb.width());
|
modifierColorBarTopAxis->setOtherAxisWidth(cb.width());
|
||||||
modifierColorBarTopAxis->drawAxes(painter);
|
modifierColorBarTopAxis->drawAxes(painter);
|
||||||
} else {
|
} else {
|
||||||
if ( JKQTPCADrawModeHasLine(colorBarTopAxis->getDrawMode1()) && JKQTPCADrawModeHasLine(colorBarTopAxis->getDrawMode2())) {
|
if ( colorBarTopAxis->getDrawMode1().testFlag(JKQTPCADMLine) && colorBarTopAxis->getDrawMode2().testFlag(JKQTPCADMLine)) {
|
||||||
painter.setPen(p);
|
painter.setPen(p);
|
||||||
painter.drawLine(QLineF(cb.topLeft(), cb.bottomLeft()));
|
painter.drawLine(QLineF(cb.topLeft(), cb.bottomLeft()));
|
||||||
painter.drawLine(QLineF(cb.topRight(), cb.bottomRight()));
|
painter.drawLine(QLineF(cb.topRight(), cb.bottomRight()));
|
||||||
|
@ -39,36 +39,42 @@
|
|||||||
|
|
||||||
|
|
||||||
QString JKQTPCADrawMode2String(JKQTPCADrawMode pos) {
|
QString JKQTPCADrawMode2String(JKQTPCADrawMode pos) {
|
||||||
switch(pos) {
|
if (pos==JKQTPCADMnone) return "none";
|
||||||
case JKQTPCADMcomplete: return "all";
|
if (pos==JKQTPCADMcomplete) return "complete";
|
||||||
case JKQTPCADMTicksTickLabelsAxisLabel: return "ticks+labels+axislabel";
|
if (pos==JKQTPCADMcompleteMaxArrow) return "complete+max_filled_arrow";
|
||||||
case JKQTPCADMTicksTickLabels: return "ticks+labels";
|
if (pos==JKQTPCADMcompleteMinMaxArrow) return "complete+max_filled_arrow+min_filled_arrow";
|
||||||
case JKQTPCADMTicks: return "ticks";
|
|
||||||
case JKQTPCADMLineTicksTickLabels: return "line+ticks+labels";
|
QString s="";
|
||||||
case JKQTPCADMTickLabelsAxisLabel: return "labels+axislabel";
|
if (pos.testFlag(JKQTPCADMLine)) JKQTPExtendString(s, "+", "line");
|
||||||
case JKQTPCADMTickLabels: return "labels";
|
if (pos.testFlag(JKQTPCADMMaxArrow)) JKQTPExtendString(s, "+", "max_arrow");
|
||||||
case JKQTPCADMLineTicks: return "line+ticks";
|
if (pos.testFlag(JKQTPCADMMaxFilledArrow)) JKQTPExtendString(s, "+", "max_filled_arrow");
|
||||||
case JKQTPCADMLine: return "line";
|
if (pos.testFlag(JKQTPCADMMinArrow)) JKQTPExtendString(s, "+", "min_arrow");
|
||||||
case JKQTPCADMnone: return "none";
|
if (pos.testFlag(JKQTPCADMMinFilledArrow)) JKQTPExtendString(s, "+", "min_filled_arrow");
|
||||||
}
|
if (pos.testFlag(JKQTPCADMTicks)) JKQTPExtendString(s, "+", "ticks");
|
||||||
return "";
|
if (pos.testFlag(JKQTPCADMTickLabels)) JKQTPExtendString(s, "+", "labels");
|
||||||
|
if (pos.testFlag(JKQTPCADMAxisLabel)) JKQTPExtendString(s, "+", "axislabel");
|
||||||
|
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
JKQTPCADrawMode String2JKQTPCADrawMode(const QString& pos) {
|
JKQTPCADrawMode String2JKQTPCADrawMode(const QString& pos) {
|
||||||
QString s=pos.trimmed().toLower();
|
QStringList slist=pos.trimmed().toLower().split('+');
|
||||||
if (s=="all" || s=="complete" || s=="line+ticks+labels+axislabel") return JKQTPCADMcomplete;
|
|
||||||
if (s=="ticks+labels+axislabel") return JKQTPCADMTicksTickLabelsAxisLabel;
|
JKQTPCADrawMode res=JKQTPCADMnone;
|
||||||
if (s=="labels+axislabel") return JKQTPCADMTickLabelsAxisLabel;
|
for (const QString& s: slist) {
|
||||||
if (s=="ticks+labels") return JKQTPCADMTicksTickLabels;
|
if (s=="all" || s=="complete") res |= JKQTPCADMcomplete;
|
||||||
if (s=="line+ticks+labels") return JKQTPCADMLineTicksTickLabels;
|
if (s=="labels" || s=="ticklabels") res |= JKQTPCADMTickLabels;
|
||||||
if (s=="labels") return JKQTPCADMTickLabels;
|
if (s=="axislabel") res |= JKQTPCADMAxisLabel;
|
||||||
if (s=="line+ticks") return JKQTPCADMLineTicks;
|
if (s=="ticks") res |= JKQTPCADMTicks;
|
||||||
if (s=="ticks") return JKQTPCADMTicks;
|
if (s=="line") res |= JKQTPCADMLine;
|
||||||
if (s=="line") return JKQTPCADMLine;
|
if (s=="max_arrow"||s=="maxarrow") res |= JKQTPCADMMaxArrow;
|
||||||
if (s=="none") return JKQTPCADMnone;
|
if (s=="max_filled_arrow"||s=="maxfilledarrow") res |= JKQTPCADMMaxFilledArrow;
|
||||||
return JKQTPCADMnone;
|
if (s=="min_arrow"||s=="minarrow") res |= JKQTPCADMMinArrow;
|
||||||
|
if (s=="min_filled_arrow"||s=="minfilledarrow") res |= JKQTPCADMMinFilledArrow;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -108,6 +114,7 @@ QString JKQTPCALabelType2String(JKQTPCALabelType pos) {
|
|||||||
case JKQTPCALTfrac: return "frac";
|
case JKQTPCALTfrac: return "frac";
|
||||||
case JKQTPCALTsfrac: return "sfrac";
|
case JKQTPCALTsfrac: return "sfrac";
|
||||||
case JKQTPCALTslashfrac: return "slashfrac";
|
case JKQTPCALTslashfrac: return "slashfrac";
|
||||||
|
case JKQTPCALTcount: return "";
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@ -391,26 +398,6 @@ QString JKQTPMouseDragActions2String(JKQTPMouseDragActions act)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool JKQTPCADrawModeHasLine(JKQTPCADrawMode pos)
|
|
||||||
{
|
|
||||||
return (pos==JKQTPCADMcomplete) || (pos==JKQTPCADMLineTicksTickLabels) || (pos==JKQTPCADMLineTicks) || (pos==JKQTPCADMLine);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool JKQTPCADrawModeHasTicks(JKQTPCADrawMode pos)
|
|
||||||
{
|
|
||||||
return (pos==JKQTPCADMcomplete) || (pos==JKQTPCADMTicksTickLabelsAxisLabel) || (pos==JKQTPCADMLineTicks) || (pos==JKQTPCADMLineTicksTickLabels) || (pos==JKQTPCADMTicksTickLabels)|| (pos==JKQTPCADMTicks);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool JKQTPCADrawModeHasTickLabels(JKQTPCADrawMode pos)
|
|
||||||
{
|
|
||||||
return (pos==JKQTPCADMcomplete) || (pos==JKQTPCADMTicksTickLabelsAxisLabel) || (pos==JKQTPCADMLineTicksTickLabels) || (pos==JKQTPCADMTicksTickLabels) || (pos==JKQTPCADMTickLabels) || (pos==JKQTPCADMTickLabelsAxisLabel);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool JKQTPCADrawModeHasAxisLabel(JKQTPCADrawMode pos)
|
|
||||||
{
|
|
||||||
return (pos==JKQTPCADMcomplete) || (pos==JKQTPCADMTicksTickLabelsAxisLabel) || (pos==JKQTPCADMTickLabelsAxisLabel);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
JKQTPColorDerivationMode::JKQTPColorDerivationMode(PredefinedModes mode):
|
JKQTPColorDerivationMode::JKQTPColorDerivationMode(PredefinedModes mode):
|
||||||
colorModification(ColorChangeMode::SameColor),
|
colorModification(ColorChangeMode::SameColor),
|
||||||
|
@ -385,42 +385,45 @@ JKQTPLOTTER_LIB_EXPORT QString JKQTPColorDerivationMode2String(JKQTPColorDerivat
|
|||||||
JKQTPLOTTER_LIB_EXPORT JKQTPColorDerivationMode String2JKQTPColorDerivationMode(const QString &mode);
|
JKQTPLOTTER_LIB_EXPORT JKQTPColorDerivationMode String2JKQTPColorDerivationMode(const QString &mode);
|
||||||
|
|
||||||
|
|
||||||
/** \brief display mode for an axis
|
/** \brief drawing flags for a coordinate axis
|
||||||
* \ingroup jkqtpplottersupprt */
|
* \ingroup jkqtpplottersupprt
|
||||||
enum JKQTPCADrawMode {
|
*
|
||||||
JKQTPCADMcomplete=0, /*!< \brief draw axis with ticks, ticklabels and axis label */
|
* \note This enum provides the elements for \ref JKQTPCADrawMode, which is actually used
|
||||||
JKQTPCADMLineTicksTickLabels, /*!< \brief draw axis with ticks, line and tick labels */
|
* throughout the code.
|
||||||
JKQTPCADMLineTicks, /*!< \brief draw axis with ticks and line */
|
*
|
||||||
JKQTPCADMLine, /*!< \brief draw axis as thick line */
|
* \see JKQTPCADrawMode, JKQTPCoordinateAxisStyle
|
||||||
JKQTPCADMTicksTickLabelsAxisLabel, /*!< \brief draw axis with ticks, tick labels and axisLabel */
|
*/
|
||||||
JKQTPCADMTicksTickLabels, /*!< \brief draw axis with ticks and tick labels */
|
enum JKQTPCADrawModeElements {
|
||||||
JKQTPCADMTickLabelsAxisLabel, /*!< \brief draw axis tick labels and axisLabel */
|
JKQTPCADMLine=0x01, /*!< \brief draw axis as thick line \image html axisstyle/JKQTPCADMLine.png */
|
||||||
JKQTPCADMTickLabels, /*!< \brief draw axis tick labels */
|
JKQTPCADMTicks=0x02, /*!< \brief draw axis ticks \image html axisstyle/JKQTPCADMTicks.png */
|
||||||
JKQTPCADMTicks, /*!< \brief draw axis with ticks */
|
JKQTPCADMTickLabels=0x04, /*!< \brief draw axis tick labels \image html axisstyle/JKQTPCADMTickLabels.png */
|
||||||
JKQTPCADMnone, /*!< \brief draw no axis */
|
JKQTPCADMAxisLabel=0x08, /*!< \brief draw axis axis Label \image html axisstyle/JKQTPCADMAxisLabel.png */
|
||||||
|
|
||||||
JKQTPCADMmax=JKQTPCADMnone
|
JKQTPCADMMaxArrow=0x0100, /*!< \brief an open arrow at the max-end of the axis \image html axisstyle/JKQTPCADMMaxArrow.png */
|
||||||
|
JKQTPCADMMaxFilledArrow=0x0200, /*!< \brief draw a filled arrow at the max-end of the axis \image html axisstyle/JKQTPCADMMaxFilledArrow.png */
|
||||||
|
JKQTPCADMMinArrow=0x1000, /*!< \brief an open arrow at the end of the axis at the min-end of the axis \image html axisstyle/JKQTPCADMMinArrow.png */
|
||||||
|
JKQTPCADMMinFilledArrow=0x2000, /*!< \brief draw a filled arrow at the min-end of the axis \image html axisstyle/JKQTPCADMMinFilledArrow.png */
|
||||||
|
|
||||||
|
JKQTPCADMLineTicksTickLabels=JKQTPCADMLine|JKQTPCADMTicks|JKQTPCADMTickLabels, /*!< \brief draw axis with ticks, line and tick labels \image html axisstyle/JKQTPCADMLineTicksTickLabels.png */
|
||||||
|
JKQTPCADMLineTicks=JKQTPCADMLine|JKQTPCADMTicks, /*!< \brief draw axis with ticks and line \image html axisstyle/JKQTPCADMLineTicks.png */
|
||||||
|
JKQTPCADMTicksTickLabelsAxisLabel=JKQTPCADMTicks|JKQTPCADMTickLabels|JKQTPCADMAxisLabel, /*!< \brief draw axis with ticks, tick labels and axisLabel \image html axisstyle/JKQTPCADMTicksTickLabelsAxisLabel.png */
|
||||||
|
JKQTPCADMTicksTickLabels=JKQTPCADMTicks|JKQTPCADMTickLabels, /*!< \brief draw axis with ticks and tick labels \image html axisstyle/JKQTPCADMTicksTickLabels.png */
|
||||||
|
JKQTPCADMTickLabelsAxisLabel=JKQTPCADMTickLabels|JKQTPCADMAxisLabel, /*!< \brief draw axis tick labels and axisLabel \image html axisstyle/JKQTPCADMTickLabelsAxisLabel.png */
|
||||||
|
JKQTPCADMnone=0x0000, /*!< \brief draw no axis \image html axisstyle/JKQTPCADMnone.png */
|
||||||
|
JKQTPCADMcomplete=JKQTPCADMLine|JKQTPCADMTicks|JKQTPCADMTickLabels|JKQTPCADMAxisLabel, /*!< \brief draw axis withline, ticks, ticklabels and axis label \image html axisstyle/JKQTPCADMcomplete.png */
|
||||||
|
JKQTPCADMcompleteMaxArrow=JKQTPCADMcomplete|JKQTPCADMMaxFilledArrow, /*!< \brief draw axis withline, ticks, ticklabels and axis label and an arrow pointing to the max-side of the axis \image html axisstyle/JKQTPCADMcompleteMaxArrow.png */
|
||||||
|
JKQTPCADMcompleteMinMaxArrow=JKQTPCADMcomplete|JKQTPCADMMaxFilledArrow|JKQTPCADMMinFilledArrow, /*!< \brief draw axis withline, ticks, ticklabels and axis label and arrows pointing to the min and max side of the axis \image html axisstyle/JKQTPCADMcompleteMinMaxArrow.png */
|
||||||
};
|
};
|
||||||
|
/** \brief drawing mode for a coordinate axis
|
||||||
/** \brief determines whether JKQTPCADrawMode has the line
|
* \ingroup jkqtplotter_basegraphserrors
|
||||||
* \ingroup jkqtpplottersupprt
|
*
|
||||||
|
* \qFlagsNote{JKQTPCADrawMode,JKQTPCADrawModeElements}
|
||||||
|
*
|
||||||
|
* \see JKQTPCADrawModeElements, JKQTPCoordinateAxisStyle
|
||||||
*/
|
*/
|
||||||
JKQTPLOTTER_LIB_EXPORT bool JKQTPCADrawModeHasLine(JKQTPCADrawMode pos);
|
Q_DECLARE_FLAGS(JKQTPCADrawMode, JKQTPCADrawModeElements)
|
||||||
|
Q_DECLARE_OPERATORS_FOR_FLAGS(JKQTPCADrawMode)
|
||||||
|
|
||||||
/** \brief determines whether JKQTPCADrawMode has ticks
|
|
||||||
* \ingroup jkqtpplottersupprt
|
|
||||||
*/
|
|
||||||
JKQTPLOTTER_LIB_EXPORT bool JKQTPCADrawModeHasTicks(JKQTPCADrawMode pos);
|
|
||||||
|
|
||||||
/** \brief determines whether JKQTPCADrawMode has tick labels
|
|
||||||
* \ingroup jkqtpplottersupprt
|
|
||||||
*/
|
|
||||||
JKQTPLOTTER_LIB_EXPORT bool JKQTPCADrawModeHasTickLabels(JKQTPCADrawMode pos);
|
|
||||||
|
|
||||||
/** \brief determines whether JKQTPCADrawMode has the axis label
|
|
||||||
* \ingroup jkqtpplottersupprt
|
|
||||||
*/
|
|
||||||
JKQTPLOTTER_LIB_EXPORT bool JKQTPCADrawModeHasAxisLabel(JKQTPCADrawMode pos);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -438,19 +441,19 @@ JKQTPLOTTER_LIB_EXPORT JKQTPCADrawMode String2JKQTPCADrawMode(const QString& pos
|
|||||||
/** \brief display mode for the axis labels
|
/** \brief display mode for the axis labels
|
||||||
* \ingroup jkqtpplottersupprt */
|
* \ingroup jkqtpplottersupprt */
|
||||||
enum JKQTPCALabelType {
|
enum JKQTPCALabelType {
|
||||||
JKQTPCALTdefault, /*!< \brief simply print the numbers \image html JKQTPCALTdefault.png */
|
JKQTPCALTdefault=0, /*!< \brief simply print the numbers \image html axisstyle/JKQTPCALTdefault.png */
|
||||||
JKQTPCALTscientific, /*!< \brief print the numbers in scientific notation, e.g. \c "1.23e-4" \image html JKQTPCALTscientific.png */
|
JKQTPCALTscientific, /*!< \brief print the numbers in scientific notation, e.g. \c "1.23e-4" \image html axisstyle/JKQTPCALTscientific.png */
|
||||||
JKQTPCALTexponentCharacter, /*!< \brief print the numbers and show a unit character, i.e. 5μ for \f$ 5\cdot 10^{-6} \f$ , \c 3k for \f$ 3\cdot 10^3 \f$ ... \image html JKQTPCALTexponentCharacter.png */
|
JKQTPCALTexponentCharacter, /*!< \brief print the numbers and show a unit character, i.e. 5μ for \f$ 5\cdot 10^{-6} \f$ , \c 3k for \f$ 3\cdot 10^3 \f$ ... \image html axisstyle/JKQTPCALTexponentCharacter.png */
|
||||||
JKQTPCALTexponent, /*!< \brief show numbers in exponential for, e.g. \f$ 3\cdot 10^5 \f$ ... \image html JKQTPCALTexponent.png */
|
JKQTPCALTexponent, /*!< \brief show numbers in exponential for, e.g. \f$ 3\cdot 10^5 \f$ ... \image html axisstyle/JKQTPCALTexponent.png */
|
||||||
JKQTPCALTdate, /*!< \brief show numbers as dates \image html JKQTPCALTdate.png */
|
JKQTPCALTdate, /*!< \brief show numbers as dates \image html axisstyle/JKQTPCALTdate.png */
|
||||||
JKQTPCALTtime, /*!< \brief show numbers as times \image html JKQTPCALTtime.png*/
|
JKQTPCALTtime, /*!< \brief show numbers as times \image html axisstyle/JKQTPCALTtime.png*/
|
||||||
JKQTPCALTdatetime, /*!< \brief show numbers as times \image html JKQTPCALTdatetime.png */
|
JKQTPCALTdatetime, /*!< \brief show numbers as times \image html axisstyle/JKQTPCALTdatetime.png */
|
||||||
JKQTPCALTfrac, /*!< \brief show numbers as fraction, the number is first rounded to the given precision and then a fraction is calculated and displayed like \f$ \frac{1}{2} \f$ \image html JKQTPCALTfrac.png */
|
JKQTPCALTfrac, /*!< \brief show numbers as fraction, the number is first rounded to the given precision and then a fraction is calculated and displayed like \f$ \frac{1}{2} \f$ \image html axisstyle/JKQTPCALTfrac.png */
|
||||||
JKQTPCALTslashfrac, /*!< \brief show numbers as fraction, the number is first rounded to the given precision and then a fraction is calculated and displayed like \c 1/2 \image html JKQTPCALTslashfrac.png */
|
JKQTPCALTslashfrac, /*!< \brief show numbers as fraction, the number is first rounded to the given precision and then a fraction is calculated and displayed like \c 1/2 \image html axisstyle/JKQTPCALTslashfrac.png */
|
||||||
JKQTPCALTsfrac, /*!< \brief show numbers as fraction, the number is first rounded to the given precision and then a fraction is calculated and displayed using \c \\sfrac{1}{2} \image html JKQTPCALTsfrac.png */
|
JKQTPCALTsfrac, /*!< \brief show numbers as fraction, the number is first rounded to the given precision and then a fraction is calculated and displayed using \c \\sfrac{1}{2} \image html axisstyle/JKQTPCALTsfrac.png */
|
||||||
JKQTPCALTintfrac, /*!< \brief show numbers as integral+fraction, the number is first rounded to the given precision and then a fraction is calculated and displayed like \$ -3\frac{1}{2} \f$ \image html JKQTPCALTintfrac.png */
|
JKQTPCALTintfrac, /*!< \brief show numbers as integral+fraction, the number is first rounded to the given precision and then a fraction is calculated and displayed like \$ -3\frac{1}{2} \f$ \image html axisstyle/JKQTPCALTintfrac.png */
|
||||||
JKQTPCALTintslashfrac, /*!< \brief show numbers as integral+fraction, the number is first rounded to the given precision and then a fraction is calculated and displayed like \c 1/2 \image html JKQTPCALTintslashfrac.png */
|
JKQTPCALTintslashfrac, /*!< \brief show numbers as integral+fraction, the number is first rounded to the given precision and then a fraction is calculated and displayed like \c 1/2 \image html axisstyle/JKQTPCALTintslashfrac.png */
|
||||||
JKQTPCALTintsfrac, /*!< \brief show numbers as integral+fraction, the number is first rounded to the given precision and then a fraction is calculated and displayed using \c \\sfrac{1}{2} \image html JKQTPCALTintsfrac.png */
|
JKQTPCALTintsfrac, /*!< \brief show numbers as integral+fraction, the number is first rounded to the given precision and then a fraction is calculated and displayed using \c \\sfrac{1}{2} \image html axisstyle/JKQTPCALTintsfrac.png */
|
||||||
|
|
||||||
JKQTPCALTcount,
|
JKQTPCALTcount,
|
||||||
JKQTPCALTmax=JKQTPCALTcount-1
|
JKQTPCALTmax=JKQTPCALTcount-1
|
||||||
|
Before Width: | Height: | Size: 182 KiB After Width: | Height: | Size: 178 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |