mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 01:51:49 +08:00
doc update and many bugfixes
This commit is contained in:
parent
503ef13275
commit
dd940ab569
@ -100,7 +100,7 @@ All test-projects are Qt-projects that use qmake to build. You can load them int
|
||||
<tr><td> \image html paramvectorfield_small.png
|
||||
<td> \subpage JKQTPParametrizedVectorFieldGraphExample
|
||||
<td> `JKQTPParametrizedVectorFieldGraph`
|
||||
<tr><td> \image html financialgraph_small.png
|
||||
<tr><td> \image html financialgraphs_small.png
|
||||
<td> \subpage JKQTPlotterFinancialChartExample
|
||||
<td> `JKQTPFinancialGraph` (Candlestick/OHLC graphs), date-axis, rotated labels
|
||||
</table>
|
||||
|
@ -133,7 +133,7 @@
|
||||
|
||||
\section JKQTMathTextSuppoertedLaTeXVerbatim Verbatim Text
|
||||
Sometimes it is necessary to typeset text withou interpreting it as LaTeX markup. These instructions are implemented for that:
|
||||
- <code>\\verb!...!</code>: interpret enclosed text between \c ! as verbose. Instead of \ ! you can choose ANY character! \image html jkqtmathtext/jkqtmathtext_verb.png generated by <code>\\verb!\\LaTeX{} is not pares inside \\verb~..~! outside {\\backslash}verb</code>
|
||||
- <code>\\verb!...!</code>: interpret enclosed text between \c ! as verbose. Instead of \ ! you can choose ANY character! \image html jkqtmathtext/jkqtmathtext_verb.png "generated by <code>\\verb!\\LaTeX{} is not pares inside \\verb~..~! outside {\\backslash}verb</code>"
|
||||
- <code>\\begin{verbatim}...\\end{verbatim}</code>: interpret enclosed multi-line text as verbatim. \image html jkqtmathtext/jkqtmathtext_verbatim.png
|
||||
- <code>\\begin{lstlisting}...\\end{lstlisting}</code>: actually menat for highlighted code, for now this is the same as \c \\begin{verbatim}...\\end{verbatim}. \image html jkqtmathtext/jkqtmathtext_lstlisting.png
|
||||
- <code>\\begin{verbatim*}...\\end{verbatim*}</code>: interpret enclosed multi-line text as verbatim. Print with visible whitespace and tab characters \image html jkqtmathtext/jkqtmathtext_verbatimast.png
|
||||
@ -146,9 +146,9 @@
|
||||
- \c \\alpha ... : display the according greek letter in italic style (see \ref jkqtmathtext_supportedlatexsymbols ) \image html jkqtmathtext/jkqtmathtext_greek.png
|
||||
- \c \\upalpha ... : display the according upright greek letter. This letter is always upright, independent of the surrounding environment (see \ref jkqtmathtext_supportedlatexsymbols ) \image html jkqtmathtext/jkqtmathtext_upgreek.png
|
||||
- \c \\textalpha ... : display the according greek letter with italic style defined by the current environment (i.e. italic in mathmode or inside \c \\textit{\\alpha} and upright in text mode). (see \ref jkqtmathtext_supportedlatexsymbols ) \image html jkqtmathtext/jkqtmathtext_textgreek.png
|
||||
- \c \\charDECIMAL and \c \\char\"HEX and \c \\char\'OCTAL : draws a unicode character from its 32-bit codepoint \image html jkqtmathtext/jkqtmathtext_char.png (generated by <code>A: \\char65, circonflex: \\char\"109 accent: \\char\'351</code>)
|
||||
- \c \\unicode{HEX} and \c \\usym{HEX} : draws a unicode character from its 32-bit codepoint \image html jkqtmathtext/jkqtmathtext_unicode.png (generated by <code>star: \\unicode{2605}, circonflex: \\unicode{109} emoticons: \\usym{1F440} \\usym{1F929}</code>)
|
||||
- \c \\utfeight{HEX} : draws a unicode character from its UTF-8 encoding \image html jkqtmathtext/jkqtmathtext_utf8.png (generated by <code>star: \\utfeight{e29885} emoticons \\utfeight{F09F9881} \\utfeight{f09f98bb}</code>)
|
||||
- \c \\charDECIMAL and \c \\char\"HEX and \c \\char\'OCTAL : draws a unicode character from its 32-bit codepoint \image html jkqtmathtext/jkqtmathtext_char.png "(generated by <code>A: \\char65, circonflex: \\char\"109 accent: \\char\'351</code>)"
|
||||
- \c \\unicode{HEX} and \c \\usym{HEX} : draws a unicode character from its 32-bit codepoint \image html jkqtmathtext/jkqtmathtext_unicode.png "(generated by <code>star: \\unicode{2605}, circonflex: \\unicode{109} emoticons: \\usym{1F440} \\usym{1F929}</code>)"
|
||||
- \c \\utfeight{HEX} : draws a unicode character from its UTF-8 encoding \image html jkqtmathtext/jkqtmathtext_utf8.png "(generated by <code>star: \\utfeight{e29885} emoticons \\utfeight{F09F9881} \\utfeight{f09f98bb}</code>)"
|
||||
- The usual LaTeX-accent commands are also implemented here and work as expected in text-mode, provided the matching unicode characters are available in the current font.
|
||||
\image html jkqtmathtext/jkqtmathtext_textaccents.png
|
||||
- In math-mode the text-accent commands do not work. here you have to use the math-mode commands:
|
||||
@ -248,25 +248,25 @@
|
||||
For text-mode tables, the \c tabular -environment is supported:
|
||||
- <code>$\\begin{tabular}{COLSPEC} a & b & ...\\\\ c & d & ...\\end{tabular}$</code>
|
||||
\c COLSPEC is a LaTeX column specifier, i.e. a sequence composed of these parts:
|
||||
- \c l : left-aligned column
|
||||
- \c c : centered column
|
||||
- \c r : right-aligned column
|
||||
- \c | : single line
|
||||
- \c || : double line
|
||||
- \c : : single dashed line
|
||||
- \c :: : double dashed line
|
||||
- \c l : left-aligned column
|
||||
- \c c : centered column
|
||||
- \c r : right-aligned column
|
||||
- \c | : single line
|
||||
- \c || : double line
|
||||
- \c : : single dashed line
|
||||
- \c :: : double dashed line
|
||||
.
|
||||
.
|
||||
In all these environments, you can use the following instructions to draw lines above/below a row in the matrix:
|
||||
.
|
||||
In all these environments, you can use the following instructions to draw lines above/below a row in the matrix:
|
||||
- \c \\hline or \c \\midrule: a single line
|
||||
- \c \\hline\\hline : a double line
|
||||
- \c \\toprule or \c \\bottomrule : a heavy line
|
||||
- \c \\hdashline : a single dashed line
|
||||
- \c \\hdashline\\hdashline : a double dashed line
|
||||
.
|
||||
.
|
||||
|
||||
Here is an example:
|
||||
\code
|
||||
Here is an example:
|
||||
\code
|
||||
\begin{tabular}{:l|cr||}
|
||||
\hdashline
|
||||
a1--- & b1--- & c1---\\
|
||||
@ -277,9 +277,9 @@
|
||||
a4 & b4 & c4\\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\endcode
|
||||
\endcode
|
||||
|
||||
\image html jkqtmathtext/jkqtmathtext_tabular.png
|
||||
\image html jkqtmathtext/jkqtmathtext_tabular.png
|
||||
|
||||
|
||||
\section JKQTMathTextSuppoertedLaTeXMathSupport Supported Mathematical Constructs
|
||||
|
@ -1,186 +0,0 @@
|
||||
/*!
|
||||
|
||||
|
||||
\defgroup jkqtplotter_graphsgroup_classstructure Graphs
|
||||
\ingroup jkqtplotter_general
|
||||
|
||||
\section jkqtplotter_graphsgroup_classstructure_basics Graph Class Structure
|
||||
|
||||
Each type of graph is represented by another class, which has to be derived from JKQTPPlotElement. This class provides a basic virtual interface
|
||||
that allows JKQTPlotter to draw the graphs represented by them. This interface consists of these functions:
|
||||
- JKQTPPlotElement::draw() draws the graph onto a given JKQTPEnhancedPainter (derived from <a href="http://doc.qt.io/qt-5/qpainter.html">QPainter</a>)
|
||||
- JKQTPPlotElement::drawKeyMarker() draws the small marker image in the plot legend
|
||||
- JKQTPPlotElement::getKeyLabelColor() returns a color for the legend entry for the graph
|
||||
- JKQTPPlotElement::getXMinMax() returns the extent of the graph in x-direction (e.g. for auto-zooming)
|
||||
- JKQTPPlotElement::getYMinMax() returns the extent of the graph in Y-direction (e.g. for auto-zooming)
|
||||
.
|
||||
In addition to these basic functions, there are additional functions that can be used to draw something outside the actual plot rectangle.
|
||||
These are used to e.g. add color-scales to the side of the graph:
|
||||
- JKQTPPlotElement::getOutsideSize() returns the amount of space required outside the plot rectangle
|
||||
- JKQTPPlotElement::drawOutside() draws the elements outside the plot rectangle
|
||||
.
|
||||
|
||||
Usually if writing a new graph, one would not directly
|
||||
derive from JKQTPPlotElement, but from a cass in it's hirarchy of children. These children already provide certain facilities for certain types of graphs.
|
||||
|
||||
\dot
|
||||
digraph
|
||||
{
|
||||
// LATEX_PDF_SIZE
|
||||
bgcolor="transparent";
|
||||
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
|
||||
node [fontname="FreeSans",fontsize="10"];
|
||||
rankdir="LR";
|
||||
|
||||
{
|
||||
rank=same;
|
||||
JKQTPPlotElement [URL="\ref JKQTPPlotElement"];
|
||||
noteJKQTPPlotElement [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\nelements drawn\nonto a plot"];
|
||||
JKQTPPlotElement -> noteJKQTPPlotElement [style=dashed,arrowhead=none];
|
||||
}
|
||||
|
||||
{
|
||||
rank=same;
|
||||
JKQTPGraph [URL="\ref JKQTPPlotElement"];
|
||||
noteJKQTPGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\nactual graphs"];
|
||||
JKQTPGraph -> noteJKQTPGraph [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPGeometricPlotElement [URL="\ref JKQTPGeometricPlotElement"];
|
||||
noteJKQTPGeometricPlotElement [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\nnon-graph elements,\ne.g. geometric elements"];
|
||||
JKQTPGeometricPlotElement -> noteJKQTPGeometricPlotElement [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPPlotAnnotationElement [URL="\ref JKQTPPlotAnnotationElement"];
|
||||
noteJKQTPPlotAnnotationElement [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraph annotation elements,\ne.g. text, symbols, ranges ..."];
|
||||
JKQTPPlotAnnotationElement -> noteJKQTPPlotAnnotationElement [style=dashed,arrowhead=none];
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
rank=same;
|
||||
|
||||
JKQTPXYGraph [URL="\ref JKQTPXYGraph"]
|
||||
noteJKQTPXYGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on\n (x,y) data pairs"];
|
||||
JKQTPXYGraph -> noteJKQTPXYGraph [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPSingleColumnGraph [URL="\ref JKQTPSingleColumnGraph"]
|
||||
noteJKQTPSingleColumnGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on only\n a single column of data"];
|
||||
JKQTPSingleColumnGraph -> noteJKQTPSingleColumnGraph [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPImageBase [URL="\ref JKQTPImageBase"]
|
||||
noteJKQTPImageBase [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs that represent \n2D images/matrices"];
|
||||
JKQTPImageBase -> noteJKQTPImageBase [style=dashed,arrowhead=none];
|
||||
}
|
||||
|
||||
{
|
||||
rank=same;
|
||||
|
||||
JKQTPXYYGraph [URL="\ref JKQTPXYYGraph"]
|
||||
noteJKQTPXYYGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on\n (x, y1, y2) data triples"];
|
||||
JKQTPXYYGraph -> noteJKQTPXYYGraph [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPXXYGraph [URL="\ref JKQTPXXYGraph"]
|
||||
noteJKQTPXXYGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on\n (x1, x2, y) data triples"];
|
||||
JKQTPXXYGraph -> noteJKQTPXXYGraph [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPXYAndVectorGraph [URL="\ref JKQTPXYAndVectorGraph"]
|
||||
noteJJKQTPXYAndVectorGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\nvector field graphs based on\n (x, y, dx, dy) data quadruples"];
|
||||
JKQTPXYAndVectorGraph -> noteJJKQTPXYAndVectorGraph [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPXYBaselineGraph [URL="\ref JKQTPXYBaselineGraph"]
|
||||
noteJJKQTPXYBaselineGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on\n (x,y) data pairs and a baseline"];
|
||||
JKQTPXYBaselineGraph -> noteJJKQTPXYBaselineGraph [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPEvaluatedFunctionGraphBase [URL="\ref JKQTPEvaluatedFunctionGraphBase"]
|
||||
noteJKQTPEvaluatedFunctionGraphBase [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs that represent \ndynamically evaluated functions"];
|
||||
JKQTPEvaluatedFunctionGraphBase -> noteJKQTPEvaluatedFunctionGraphBase [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPMathImageBase [URL="\ref JKQTPMathImageBase"]
|
||||
noteJKQTPMathImageBase [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ndata-based images"];
|
||||
JKQTPMathImageBase -> noteJKQTPMathImageBase [style=dashed,arrowhead=none];
|
||||
}
|
||||
|
||||
{
|
||||
rank=same;
|
||||
|
||||
JKQTPBarGraphBase [URL="\ref JKQTPBarGraphBase"]
|
||||
noteJKQTPBarGraphBase [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\nbarcharts"];
|
||||
JKQTPBarGraphBase -> noteJKQTPBarGraphBase [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPFilledCurveGraphBase [URL="\ref JKQTPFilledCurveGraphBase"]
|
||||
noteJKQTPFilledCurveGraphBase [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\nfilled graphs"];
|
||||
JKQTPFilledCurveGraphBase -> noteJKQTPFilledCurveGraphBase [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPImpulsesGraphBase [URL="\ref JKQTPImpulsesGraphBase"]
|
||||
noteJKQTPImpulsesGraphBase [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\nimpulse graphs"];
|
||||
JKQTPImpulsesGraphBase -> noteJKQTPImpulsesGraphBase [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPSpecialLineGraphBase [URL="\ref JKQTPSpecialLineGraphBase"]
|
||||
noteJKQTPSpecialLineGraphBase [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\nspecial line graphs"];
|
||||
JKQTPSpecialLineGraphBase -> noteJKQTPSpecialLineGraphBase [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPBoxplotGraphBase [URL="\ref JKQTPBoxplotGraphBase"]
|
||||
noteJKQTPBoxplotGraphBase [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs that represent \na set of boxplots"];
|
||||
JKQTPBoxplotGraphBase -> noteJKQTPBoxplotGraphBase [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPRangeBase [URL="\ref JKQTPRangeBase"];
|
||||
noteJKQTPRangeBase [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\nrange annotations"];
|
||||
JKQTPRangeBase -> noteJKQTPRangeBase [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPBoxplotElementBase [URL="\ref JKQTPBoxplotElementBase"]
|
||||
noteJKQTPBoxplotElementBase [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs that represent \na single boxplot"];
|
||||
JKQTPBoxplotElementBase -> noteJKQTPBoxplotElementBase [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPViolinplotElementBase [URL="\ref JKQTPViolinplotElementBase"]
|
||||
noteJKQTPViolinplotElementBase [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs that represent \na single violin plot"];
|
||||
JKQTPViolinplotElementBase -> noteJKQTPViolinplotElementBase [style=dashed,arrowhead=none];
|
||||
}
|
||||
|
||||
JKQTPPlotElement -> JKQTPGraph
|
||||
JKQTPPlotElement -> JKQTPGeometricPlotElement
|
||||
JKQTPPlotElement -> JKQTPPlotAnnotationElement
|
||||
JKQTPPlotElement -> JKQTPRangeBase
|
||||
JKQTPPlotElement -> JKQTPBoxplotElementBase
|
||||
JKQTPPlotElement -> JKQTPViolinplotElementBase
|
||||
|
||||
JKQTPGraph -> JKQTPXYGraph
|
||||
JKQTPGraph -> JKQTPSingleColumnGraph
|
||||
JKQTPGraph -> JKQTPImageBase -> JKQTPMathImageBase
|
||||
JKQTPGraph -> JKQTPEvaluatedFunctionGraphBase
|
||||
JKQTPGraph -> JKQTPBoxplotGraphBase
|
||||
|
||||
JKQTPXYGraph -> JKQTPXYYGraph
|
||||
JKQTPXYGraph -> JKQTPXXYGraph
|
||||
JKQTPXYGraph -> JKQTPXYBaselineGraph
|
||||
|
||||
JKQTPXYBaselineGraph -> JKQTPBarGraphBase
|
||||
JKQTPXYBaselineGraph -> JKQTPFilledCurveGraphBase
|
||||
JKQTPXYBaselineGraph -> JKQTPImpulsesGraphBase
|
||||
JKQTPXYBaselineGraph -> JKQTPSpecialLineGraphBase
|
||||
|
||||
}
|
||||
\enddot
|
||||
|
||||
|
||||
\section jkqtplotter_graphsgroup_classstructure_mixins Mix-In Classes for Graphs
|
||||
|
||||
\see \ref jkqtplotter_mixins
|
||||
|
||||
In addition there are mix-in classes that are used via multiple inheritance
|
||||
that add additional features and properties to a graph. A prominent example are the classes for \ref jkqtplotter_basegraphserrors "error indicators".
|
||||
With these there are usually two variants of one type of graph: One without error indicators and one with error indicators, e.g.:
|
||||
- JKQTPXYLineGraph shows lines+symbols graphs made up from x/y-value pairs for each data point.
|
||||
- JKQTPXYLineErrorGraph extends JKQTPXYLineGraph with error indicator drawing/properties provided by JKQTPXYGraphErrors
|
||||
.
|
||||
This approach allows to keep interfaces and appearance recognizeable over different graph classes and locates the source code
|
||||
for a feature like error indicators in a single/in few class(es).
|
||||
|
||||
Another example of such a class is JKQTPColorPaletteStyleAndToolsMixin, which provides functions that allow to use color palettes. It is
|
||||
mainly used for the \ref jkqtplotter_imagelots "Image/Matrix graphs", but also by e.g. JKQTPXYParametrizedScatterGraph.
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
@ -62,6 +62,10 @@
|
||||
noteJKQTPXYGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on\n (x,y) data pairs"];
|
||||
JKQTPXYGraph -> noteJKQTPXYGraph [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPXGraph [URL="\ref JKQTPXGraph"]
|
||||
noteJKQTPXGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on\n (x,....) data e.g. JKQTPFinancialGraph"];
|
||||
JKQTPXGraph -> noteJKQTPXGraph [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPSingleColumnGraph [URL="\ref JKQTPSingleColumnGraph"]
|
||||
noteJKQTPSingleColumnGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on only\n a single column of data"];
|
||||
JKQTPSingleColumnGraph -> noteJKQTPSingleColumnGraph [style=dashed,arrowhead=none];
|
||||
@ -75,13 +79,17 @@
|
||||
rank=same;
|
||||
|
||||
JKQTPXYYGraph [URL="\ref JKQTPXYYGraph"]
|
||||
noteJKQTPXYYGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on\n (x, y1, y2) data tripels"];
|
||||
noteJKQTPXYYGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on\n (x, y1, y2) data triples"];
|
||||
JKQTPXYYGraph -> noteJKQTPXYYGraph [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPXXYGraph [URL="\ref JKQTPXXYGraph"]
|
||||
noteJKQTPXXYGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on\n (x1, x2, y) data tripels"];
|
||||
noteJKQTPXXYGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on\n (x1, x2, y) data triples"];
|
||||
JKQTPXXYGraph -> noteJKQTPXXYGraph [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPXYAndVectorGraph [URL="\ref JKQTPXYAndVectorGraph"]
|
||||
noteJJKQTPXYAndVectorGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\nvector field graphs based on\n (x, y, dx, dy) data quadruples"];
|
||||
JKQTPXYAndVectorGraph -> noteJJKQTPXYAndVectorGraph [style=dashed,arrowhead=none];
|
||||
|
||||
JKQTPXYBaselineGraph [URL="\ref JKQTPXYBaselineGraph"]
|
||||
noteJJKQTPXYBaselineGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on\n (x,y) data pairs and a baseline"];
|
||||
JKQTPXYBaselineGraph -> noteJJKQTPXYBaselineGraph [style=dashed,arrowhead=none];
|
||||
@ -139,6 +147,7 @@
|
||||
JKQTPPlotElement -> JKQTPViolinplotElementBase
|
||||
|
||||
JKQTPGraph -> JKQTPXYGraph
|
||||
JKQTPGraph -> JKQTPXGraph
|
||||
JKQTPGraph -> JKQTPSingleColumnGraph
|
||||
JKQTPGraph -> JKQTPImageBase -> JKQTPMathImageBase
|
||||
JKQTPGraph -> JKQTPEvaluatedFunctionGraphBase
|
||||
@ -147,6 +156,7 @@
|
||||
JKQTPXYGraph -> JKQTPXYYGraph
|
||||
JKQTPXYGraph -> JKQTPXXYGraph
|
||||
JKQTPXYGraph -> JKQTPXYBaselineGraph
|
||||
JKQTPXYGraph -> JKQTPXYAndVectorGraph
|
||||
|
||||
JKQTPXYBaselineGraph -> JKQTPBarGraphBase
|
||||
JKQTPXYBaselineGraph -> JKQTPFilledCurveGraphBase
|
||||
|
@ -40,22 +40,99 @@ These classes are used by JKQTPlotterBase to output the plot.
|
||||
\ingroup jkqtplotter_elements
|
||||
|
||||
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Icon
|
||||
<th>
|
||||
<th>Topic/Chapter
|
||||
<tr>
|
||||
<td>\link jkqtplotter_linesymbolgraphs \image{inline} html symbols_and_styles_small.png "" \endlink
|
||||
<td>\link jkqtplotter_linesymbolgraphs \image{inline} html stepplots_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_linesymbolgraphs
|
||||
<tr>
|
||||
<td>\link jkqtplotter_filledgraphs \image{inline} html JKQTPFilledCurveXGraph_small.png "" \endlink
|
||||
<td>\link jkqtplotter_filledgraphs \image{inline} html JKQTPfilledVerticalRangeGraph_WithLines_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_filledgraphs
|
||||
<tr>
|
||||
<td>
|
||||
<td>\link jkqtplotter_sticks \image{inline} html JKQTPImpulsesVerticalGraph_Symbols_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_sticks
|
||||
<tr>
|
||||
<td>\link jkqtplotter_barcharts \image{inline} html JKQTPBarVerticalGraph_small.png "" \endlink
|
||||
<td>\link jkqtplotter_barcharts \image{inline} html JKQTPbarVerticalGraphStacked_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_barcharts
|
||||
<tr>
|
||||
<td>\link jkqtplotter_statgraphs \image{inline} html boxplot_small.png "" \endlink
|
||||
<td>\link jkqtplotter_statgraphs \image{inline} html JKQTPViolinplotVerticalElement_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_statgraphs
|
||||
<tr>
|
||||
<td>
|
||||
<td>\link jkqtplotter_eventgraphs \image{inline} html JKQTPPeakStreamGraphY_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_eventgraphs
|
||||
<tr>
|
||||
<td>\link jkqtplotter_imagelots \image{inline} html JKQTPMathImageBaseModifyNone_small.png "" \endlink
|
||||
<td>\link jkqtplotter_imagelots \image{inline} html overlayimageenhanced_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_imagelots
|
||||
<tr>
|
||||
<td>
|
||||
<td>\link jkqtplotter_imagelots_contour \image{inline} html JKQTPColumnContourPlot_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_imagelots_contour
|
||||
<tr>
|
||||
<td>
|
||||
<td>\link jkqtplotter_vectorfieldgraphs \image{inline} html paramvectorfield_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_vectorfieldgraphs
|
||||
<tr>
|
||||
<td>
|
||||
<td>\link jkqtplotter_financialgraphs \image{inline} html financialgraphs_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_financialgraphs
|
||||
<tr>
|
||||
<td>\link jkqtplotter_geoplots \image{inline} html geo_coordinateaxis0_small.png "" \endlink
|
||||
<td>\link jkqtplotter_geoplots \image{inline} html geo_text_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_geoplots
|
||||
<tr>
|
||||
<td>
|
||||
<td>\link jkqtplotter_annotations \image{inline} html JKQTPHorizontalRange_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_annotations
|
||||
<tr>
|
||||
<td>
|
||||
<td>\link jkqtplotter_graphlabels \image{inline} html JKQTPGLSimpleBoxAndLineONLYLABELS_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_graphlabels
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\defgroup jkqtplotter_linesymbolgraphs Line/Symbol Graphs
|
||||
\ingroup jkqtplotter_concretegraphs
|
||||
|
||||
This group assembles graphs that show their data with symbols and optionally with connecting lines in diferent styles:
|
||||
<table>
|
||||
<tr>
|
||||
<th> Screenshot
|
||||
<th> Classes
|
||||
<td>\link jkqtplotter_linesymbolgraphs_scatter \image{inline} html JKQTPXYScatterGraph_small.png "" \endlink
|
||||
<td>\link jkqtplotter_linesymbolgraphs_scatter \image{inline} html beeswarmplot_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_linesymbolgraphs_scatter
|
||||
<tr>
|
||||
<td>\image html symbols_and_styles_small.png
|
||||
<td> JKQTPXYLineGraph, JKQTPXYLineErrorGraph
|
||||
<td>\link jkqtplotter_linesymbolgraphs_line \image{inline} html symbols_and_styles_small.png "" \endlink
|
||||
<td>\link jkqtplotter_linesymbolgraphs_line \image{inline} html stepplots_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_linesymbolgraphs_line
|
||||
<tr>
|
||||
<td>\image html stepplots_small.png
|
||||
<td> JKQTPSpecialLineHorizontalGraph, JKQTPSpecialLineVerticalGraph
|
||||
<td>
|
||||
<td>\link jkqtplotter_linesymbolgraphs_param \image{inline} html paramscatterplot_small.png "" \endlink\endlink
|
||||
<td>\ref jkqtplotter_linesymbolgraphs_param
|
||||
<tr>
|
||||
<td>\link jkqtplotter_functiongraphs \image{inline} html functionplot_small.png "" \endlink
|
||||
<td>\link jkqtplotter_functiongraphs \image{inline} html evalcurve_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_functiongraphs
|
||||
</table>
|
||||
|
||||
|
||||
\defgroup jkqtplotter_linesymbolgraphs_scatter Scatter Graphs
|
||||
\ingroup jkqtplotter_linesymbolgraphs
|
||||
|
||||
@ -170,6 +247,7 @@ This group assembles graphs that add (textual) labels to the datapoints in a plo
|
||||
<td> JKQTPBarVerticalStackableGraph, JKQTPBarHorizontalStackableGraph
|
||||
</table>
|
||||
|
||||
|
||||
\defgroup jkqtplotter_sticks Impulse-Charts
|
||||
\ingroup jkqtplotter_concretegraphs
|
||||
|
||||
@ -201,7 +279,7 @@ This group assembles graphs that add (textual) labels to the datapoints in a plo
|
||||
<tr>
|
||||
<td>\image html JKQTPViolinplotVerticalElement_small.png
|
||||
<td> JKQTPViolinplotVerticalElement, JKQTPViolinplotHorizontalElement
|
||||
/table>
|
||||
</table>
|
||||
|
||||
\see \ref jkqtptools_math_statistics_adaptors for shortcuts to calculate statistical properties of data and then adding a plot with the results.
|
||||
|
||||
@ -273,6 +351,7 @@ Examples:
|
||||
- \ref JKQTPlotterGeometricGraphs
|
||||
.
|
||||
|
||||
|
||||
\defgroup jkqtplotter_eventgraphs Event Graphs
|
||||
\ingroup jkqtplotter_concretegraphs
|
||||
|
||||
@ -317,28 +396,32 @@ This group assembles graphs that represent financial data (such as price mmoveme
|
||||
<td> JKQTPFinancialGraph
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
\defgroup jkqtplotter_imagelots Matrix/Image Plotting
|
||||
\ingroup jkqtplotter_concretegraphs
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th> Screenshot
|
||||
<th> Classes
|
||||
<td>\link jkqtplotter_imagelots_elements \image{inline} html rgbimageplot_qt_small.png "" \endlink
|
||||
<td>\link jkqtplotter_imagelots_elements \image{inline} html JKQTPMathImageBaseModifyNone_small.png "" \endlink
|
||||
<td>\ref jkqtplotter_imagelots_elements
|
||||
<tr>
|
||||
<td>\image html rgbimageplot_qt_small.png
|
||||
<td> JKQTPImage
|
||||
<td>
|
||||
<td>\link jkqtplotter_imagelots_overlays \image{inline} html overlayimageenhanced_small.png "" \endlink\endlink
|
||||
<td>\ref jkqtplotter_imagelots_overlays
|
||||
<tr>
|
||||
<td>\image html JKQTPMathImageBaseModifyNone_small.png
|
||||
<td> JKQTPMathImage, JKQTPColumnMathImage
|
||||
<td>
|
||||
<td>\link jkqtplotter_imagelots_contour \image{inline} html JKQTPColumnContourPlot_small.png "" \endlink\endlink
|
||||
<td>\ref jkqtplotter_imagelots_contour
|
||||
<tr>
|
||||
<td>\image html rgbimageplots_small.png
|
||||
<td> JKQTPRGBMathImage, JKQTPColumnRGBMathImage
|
||||
<td>
|
||||
<td>\link jkqtplotter_vectorfieldgraphs \image{inline} html paramvectorfield_small.png "" \endlink\endlink
|
||||
<td>\ref jkqtplotter_vectorfieldgraphs
|
||||
<tr>
|
||||
<td>\image html overlayimage_small.png
|
||||
<td> JKQTPOverlayImage
|
||||
<tr>
|
||||
<td>\image html overlayimageenhanced_small.png
|
||||
<td> JKQTPOverlayImageEnhanced, JKQTPColumnOverlayImageEnhanced
|
||||
<td>
|
||||
<td>\link jkqtplotter_imagelots_tools_LUTS \image{inline} html logo_palette_luts.png "" \endlink\endlink
|
||||
<td>\ref jkqtplotter_imagelots_tools_LUTS
|
||||
</table>
|
||||
|
||||
\defgroup jkqtplotter_imagelots_elements Image Graphs
|
||||
|
@ -31,10 +31,10 @@
|
||||
- C++ standard iterator interface
|
||||
- \ref jkqtptools_math_statistics (basic statistics, boxplots, histograms, kernel density estimates, regression analysis, polynomial fitting)
|
||||
- <b>\ref jkqtplotter_elements "large variety of graphs that can be added to a plot", e.g.:</b>
|
||||
- \ref jkqtplotter_linesymbolgraphs_simple "scatter-plots" (also \ref jkqtplotter_linesymbolgraphs_param "parametrized color/size/symbol by a third data-column")
|
||||
- \ref jkqtplotter_linesymbolgraphs "line graphs, step graphs", \ref jkqtplotter_barssticks "impulses"
|
||||
- \ref jkqtplotter_linesymbolgraphs_scatter "scatter-plots" (also \ref jkqtplotter_linesymbolgraphs_param "parametrized color/size/symbol by a third data-column")
|
||||
- \ref jkqtplotter_linesymbolgraphs "line graphs, step graphs", \ref jkqtplotter_sticks "impulses"
|
||||
- \ref jkqtplotter_filledgraphs "filled curves"
|
||||
- \ref jkqtplotter_barssticks "barcharts (also stacked)"
|
||||
- \ref jkqtplotter_barcharts "barcharts (also stacked)"
|
||||
- extensive support for different styles of error indicators
|
||||
- \ref jkqtptools_math_parser "integrated mathematical function parser for function plots (with intelligent rendering algorithm)"
|
||||
- \ref jkqtplotter_functiongraphs "line/scatter graphs can also be based on C/C++ functions instead of data series (C++11 support!)"
|
||||
@ -75,6 +75,6 @@
|
||||
|
||||
|
||||
|
||||
\image html screenshotsbanner.png
|
||||
\link exampleTutorialProjects \image html examplesbanner.png "" \endlink
|
||||
|
||||
*/
|
@ -53,8 +53,8 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
|
||||
<li>FIXED: fixes strange rendering with distortions (especially in text!), by correcting size calculation of internal image buffer</li>
|
||||
<li>FIXED: exporting gridPrinting plots when using only a JKQTBasePlotter</li>
|
||||
<li>FIXED: fixed impleentations of JKQTPlotter::beginGraphs(), which actually returned the end-iterator (COPY-PASTE-ERROR!!!)</li>
|
||||
<li>FIXED issue <a href="https://github.com/jkriege2/JKQtPlotter/pull/99">#99: Clipping of Tick Labels</a>: for horizontal axes, additional space at the left and/or right of the plot is allowed so labels are no longer clipped (thanks to <a href="https://github.com/allenbarnett5">user:allenbarnett5/a> for reporting)</li>
|
||||
<li>FIXED issue <a href="https://github.com/jkriege2/JKQtPlotter/pull/99">#99: Height of one-column key/legend was too large</a> (thanks to <a href="https://github.com/allenbarnett5">user:allenbarnett5/a> for reporting)</li>
|
||||
<li>FIXED issue <a href="https://github.com/jkriege2/JKQtPlotter/pull/99">#99: Clipping of Tick Labels</a>: for horizontal axes, additional space at the left and/or right of the plot is allowed so labels are no longer clipped (thanks to <a href="https://github.com/allenbarnett5">user:allenbarnett5</a> for reporting)</li>
|
||||
<li>FIXED issue <a href="https://github.com/jkriege2/JKQtPlotter/pull/99">#99: Height of one-column key/legend was too large</a> (thanks to <a href="https://github.com/allenbarnett5">user:allenbarnett5</a> for reporting)</li>
|
||||
<li>FIXED issue mentioned in <a href="https://github.com/jkriege2/JKQtPlotter/pull/110">#110: Lock the panning action to certain values: View zooms in, when panning close to AbosluteXY</a> (thanks to <a href="https://github.com/sim186">user:sim186</a> for reporting)</li>
|
||||
<li>FIXED: jkqtpstatSum() and jkqtpstatSumSqr() did not work, as a non-existing function is called internally</li>
|
||||
<li>FIXED removed unnecessary operators (<,>,<=,>=) from JKQTPColumnIterator and JKQTPColumnConstIterator, which lead to exceptions on some compilers (MSVC)</li>
|
||||
@ -72,7 +72,7 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
|
||||
<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>IMPROVED/REWORKED: zomm/pan by mouse-wheel: now there are modes that support zoomin AND panning by trakpad and mouse-wheel simultaneously! This can only be implemented using heuristics, due to the way that Qt handles track-pad events, but the current solution should at least improve the behaviour seen before. Mainly <code>jkqtpmwaZoomByWheelAndTrackpadPan</code> was introduced into <code>JKQTPMouseWheelActions</code> und is set as default mode: Here JKQTPlotter tries to distinguish the QWheelEvent s sent by an actual mouse wheel and a trackpad.</li>
|
||||
<li>IMPROVED/REWORKED: better example graphs in \link JKQTPlotterStyling.</li>
|
||||
<li>IMPROVED/REWORKED: better example graphs in \ref JKQTPlotterStyling .</li>
|
||||
<li>IMPROVED/REWORKED: legend/key positioning as combination of 3 values, e.g. \c JKQTPKeyOutsideTop|JKQTPKeyTop|JKQTPKeyRight or \c JKQTPKeyInside|JKQTPKeyTopJKQTPKeyRight</li>
|
||||
<li>IMPROVED/REWORKED: The functions JKQTBasePlotter::saveImage(), JKQTBasePlotter::saveAsPixelImage(), JKQTBasePlotter::saveAsPDF(), JKQTBasePlotter::saveSVG(), ... gained a bool return value to indicate whether sacing was successful.</li>
|
||||
<li>IMPROVED/REWORKED: More <code>save...()</code> functions will appear in the API of JKQTPlotter, so you don't have to go via JKQTPlotter::getPlotter(). These are merely forwarding the call to the internel JKQTBasePlotter instance.</li>
|
||||
|
BIN
doc/images/logo_palette_luts.png
Normal file
BIN
doc/images/logo_palette_luts.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
@ -5,23 +5,119 @@ The source code of the main application is (see [`financialgraphs.cpp`](https://
|
||||
|
||||
Here is a short summary of the important parts of the code:
|
||||
|
||||
|
||||
First we need to set up the plotter and then generate some data for our plot. Here we use a simple random walk (with normally distributed steps) to simulate the price of some virtual stock. We simulate severals steps ofer <code>NDays</code> days and then calculate the necessary statistics over each day (i.e. the opening and closing price, as well as the daily maximum and minimum). Alternatively you could of course also load actual stock price data and read it in youself.
|
||||
|
||||
```.cpp
|
||||
// 1. setup a plotter window and get a pointer to the internal datastore (for convenience)
|
||||
JKQTPlotter plot;
|
||||
JKQTPDatastore* ds=plot.getDatastore();
|
||||
|
||||
// 2. now we create 5 datacolumns with length Ndays entries in the datastore
|
||||
// these will later hold the time-step and simulated market data of two stocks
|
||||
const size_t NDays=31;
|
||||
const size_t columnT=ds->addColumn("time");
|
||||
const size_t columnO1=ds->addColumn("open(stock 1)");
|
||||
const size_t columnC1=ds->addColumn("close(stock 1)");
|
||||
const size_t columnL1=ds->addColumn("low(stock 1)");
|
||||
const size_t columnH1=ds->addColumn("high(stock 1)");
|
||||
const size_t columnO2=ds->addColumn("open(stock 2)");
|
||||
const size_t columnC2=ds->addColumn("close(stock 2)");
|
||||
const size_t columnL2=ds->addColumn("low(stock 2)");
|
||||
const size_t columnH2=ds->addColumn("high(stock 2)");
|
||||
const QDate t0(2024,1,8); // start date
|
||||
|
||||
// 3. now we simulate stock market data with a simple random walk
|
||||
// with a few steps per day that are summmarized into the four
|
||||
// properties Open,Close,Low,High for each day
|
||||
double price1=30; // start price of stock 1
|
||||
double price2=25; // start price of stock 2
|
||||
const size_t stepsPerDay=20;
|
||||
std::random_device rd; // random number generators:
|
||||
std::mt19937 gen{rd()};
|
||||
gen.seed(12352);
|
||||
std::normal_distribution<double> dist1(0.001, 0.6);
|
||||
std::normal_distribution<double> dist2(-0.0001, 0.4);
|
||||
for (size_t t=0; t<NDays; t+=1) {// iterate over all simulated days (we don't care for weekends)
|
||||
// step time from noon to noon in steps of days
|
||||
const QDate d=t0.addDays(t);
|
||||
ds->appendToColumn(columnT, QDateTime(d,QTime(12,0,0)).toMSecsSinceEpoch());
|
||||
// the open-Value is the start-price of each day:
|
||||
ds->appendToColumn(columnO1, price1);
|
||||
ds->appendToColumn(columnO2, price2);
|
||||
|
||||
// now we iterate the market over the day
|
||||
double L1=price1, L2=price2, H1=price1, H2=price2;
|
||||
for (size_t i=0; i<stepsPerDay; i++) { // iterate over week days (Mon-Fri)
|
||||
// prices are calculated from a sinple random walk (the while-loops ensure that we have positive prices only
|
||||
double np;
|
||||
while ((np=price1+dist1(gen))<=0.0); price1=np;
|
||||
while ((np=price2+dist2(gen))<=0.0); price2=np;
|
||||
// now we track the highest/lowest prices
|
||||
L1=qMin(L1, price1);
|
||||
L2=qMin(L2, price2);
|
||||
H1=qMax(H1, price1);
|
||||
H2=qMax(H2, price2);
|
||||
}
|
||||
// the close-Value is the final price of each day:
|
||||
ds->appendToColumn(columnC1, price1);
|
||||
ds->appendToColumn(columnC2, price2);
|
||||
|
||||
// finally we just have to add the highest and lowest prices of each day:
|
||||
ds->appendToColumn(columnL1, L1);
|
||||
ds->appendToColumn(columnL2, L2);
|
||||
ds->appendToColumn(columnH1, H1);
|
||||
ds->appendToColumn(columnH2, H2);
|
||||
}
|
||||
```
|
||||
|
||||
Now we have all columns necessary for two JKQTPFinancialGraph graphs.The first graph will be drawn in the CandleStick style and the second in the OHLC-sytle:
|
||||
|
||||
```.cpp
|
||||
|
||||
// 3. create two JKQTPFinancialGraph to display the data:
|
||||
JKQTPFinancialGraph* graphCandleStick=new JKQTPFinancialGraph(&plot);
|
||||
graphCandleStick->setXColumn(columnT);
|
||||
graphCandleStick->setOpenColumn(columnO1);
|
||||
graphCandleStick->setHighColumn(columnH1);
|
||||
graphCandleStick->setLowColumn(columnL1);
|
||||
graphCandleStick->setCloseColumn(columnC1);
|
||||
graphCandleStick->setGraphType(JKQTPFinancialGraph::CandleStick);
|
||||
graphCandleStick->setTitle(QObject::tr("stock 1 (candlestick)"));
|
||||
graphCandleStick->setCandlestickTwoColor(QColor("darkgreen"), QColor("maroon"));
|
||||
|
||||
JKQTPFinancialGraph* graphOHLC=new JKQTPFinancialGraph(&plot);
|
||||
graphOHLC->setXColumn(columnT);
|
||||
graphOHLC->setOpenColumn(columnO2);
|
||||
graphOHLC->setHighColumn(columnH2);
|
||||
graphOHLC->setLowColumn(columnL2);
|
||||
graphOHLC->setCloseColumn(columnC2);
|
||||
graphOHLC->setGraphType(JKQTPFinancialGraph::OHLC);
|
||||
graphOHLC->setTitle(QObject::tr("stock 2 (OHLC)"));
|
||||
graphOHLC->setOHLCTwoColor(QColor("darkgreen"), QColor("maroon"));
|
||||
|
||||
// 4. add the graphs to the plot, so it is actually displayed
|
||||
plot.addGraph(graphCandleStick);
|
||||
plot.addGraph(graphOHLC);
|
||||
|
||||
```
|
||||
|
||||
Finally we only have to format the plot and coordinate axes slightly to produce a nicer and better readable plot:
|
||||
|
||||
```.cpp
|
||||
|
||||
|
||||
// 5. scale the plot so the graph is contained and make x-axis a date-axis
|
||||
plot.getXAxis()->setTickLabelType(JKQTPCALTdate);
|
||||
plot.getXAxis()->setAxisLabel("time");
|
||||
plot.getXAxis()->setTickLabelAngle(35); // rotate axis tick label by 35°, so they are readable
|
||||
plot.getYAxis()->setAxisLabel("stock price [\\$]");
|
||||
plot.getMainKey()->setPosition(JKQTPKeyInsideTopLeft);
|
||||
plot.zoomToFit();```
|
||||
|
||||
|
||||
The result looks like this:
|
||||
|
||||
![financialgraphs](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/financialgraphs.png)
|
||||
|
||||
|
||||
By default, the length of the drawn vector is determined from the actual length in the data via an autoscaling algorithm that is supposed to prevent the vectors from overlapping.
|
||||
But you can modify this behaviour by adding a line
|
||||
|
||||
```.cpp
|
||||
graph1->setVectorLengthMode(JKQTPVectorFieldGraph::LengthFromData);
|
||||
```
|
||||
|
||||
which will use the given lengths directly (only scaled by an optional factor defined by JKQTPVectorFieldGraph::setLengthScaleFactor() ). The result then looks like this:
|
||||
|
||||
![financialgraphs](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/doc/images/JKQTPVectorFieldGraphLengthFromData.png)
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
<gradientstop> -> <color> (<number><b>%</b>)?
|
||||
<color> -> NAME
|
||||
| <b>#</b><hexnumber>
|
||||
| (<b>rgb</b> | <b>rgba</a> | <b>hsl</a> | <b>hsv</a> | <b>gray</a> | <b>grey</a> | <b>red</a> | <b>green</a> | <b>blue</a>) <b>(</b> (<numberwithunit> [<b>,/</b>]? ){1-4} <b>)</b>
|
||||
| (<b>rgb</b> | <b>rgba</b> | <b>hsl</b> | <b>hsv</b> | <b>gray</b> | <b>grey</b> | <b>red</b> | <b>green</b> | <b>blue</b>) <b>(</b> (<numberwithunit> [<b>,/</b>]? ){1-4} <b>)</b>
|
||||
|
||||
<number> -> floating-point-number, i.e. "[+-]?\d+\.?\d*"
|
||||
<hexnumber> -> RGB | RRGGBB | RGBA | RRGGBBAA
|
||||
|
@ -58,7 +58,6 @@ JKQTCOMMON_LIB_EXPORT Qt::BrushStyle jkqtp_String2QBrushStyle(const QString& sty
|
||||
* \param style the string to be parsed
|
||||
* \param[out] gradient output parameter for a parsed gradient
|
||||
* \param[out] image output parameter for a parsed image
|
||||
* \param[out] rotationAngleDeg output parameter for a parsed rotation angle of the pattern in degrees, where the direction equals the direction of a clock hand, i.e. 0=12o'clock, 180=6o'clock, ...
|
||||
*
|
||||
* \see jkqtp_String2QBrushStyle()
|
||||
*/
|
||||
@ -234,7 +233,7 @@ JKQTCOMMON_LIB_EXPORT QString jkqtp_QColor2String(QColor color, bool useSpecialT
|
||||
*
|
||||
* \param color the color name to convert
|
||||
* \param namesOnly if \c true , the function only compares against the list of CSS colors; otherwise it passes the string also on to QColor()-constructor, which interprets e.g. \c #AABBCC
|
||||
* \param nameFound[out] optional return value that signifies whether a name was found
|
||||
* \param[out] nameFound optional return value that signifies whether a name was found
|
||||
*/
|
||||
JKQTCOMMON_LIB_EXPORT QColor jkqtp_lookupQColorName(const QString& color, bool namesOnly=false, bool* nameFound=nullptr);
|
||||
|
||||
|
@ -66,13 +66,13 @@
|
||||
* \image html financialgraphs_width.png
|
||||
*
|
||||
*
|
||||
* \section JKQTPFinancialGraphSideBySide Severyl Financial Graphs side-by-side
|
||||
* \section JKQTPFinancialGraphSideBySide Several Financial Graphs side-by-side
|
||||
* In case you want to display several of these graphs in the same plot, you can make them appear side-by-side, even
|
||||
* if they all cover the same x-values and would thus be draw atop each other. We apply the same principles that
|
||||
* were used for barcharts in JKQTPBarGraphBase and add a shift-parameter (setShift() ) that shifts each element
|
||||
* in the available space:
|
||||
*
|
||||
* \image html financialgraphs_basics.png
|
||||
* \image html financialgraphs_shiftwidth.png
|
||||
*
|
||||
* For example for two financial graph elements per x-value one would set:
|
||||
* \verbatim
|
||||
@ -80,8 +80,6 @@
|
||||
* shift=-0.5 / +0.5
|
||||
* \endverbatim
|
||||
*
|
||||
* \image html financialgraphs_shiftwidth.png
|
||||
*
|
||||
* Two functions are provided (JKQTPFinancialGraph::autoscaleBoxWidthAndShift(), JKQTPFinancialGraph::autoscaleBoxWidthAndShiftSeparatedGroups() )
|
||||
* that can be applied to any JKQTPFinancialGraph in the plot and will calculate all JKQTPFinancialGraphs' shift and width parameter
|
||||
* in such a way that the graphs appear tidied up into groups by x-value. With these functions you don't have to calculate
|
||||
|
@ -466,22 +466,22 @@ void JKQTPXYLabelsGeneratorMixin::setYMaxNoExponent(double v)
|
||||
m_yMaxNoExponent=v;
|
||||
}
|
||||
|
||||
QString JKQTPXYLabelsGeneratorMixin::getXDateTimeFormmat() const
|
||||
QString JKQTPXYLabelsGeneratorMixin::getXDateTimeFormat() const
|
||||
{
|
||||
return m_xDateTimeFormat;
|
||||
}
|
||||
|
||||
void JKQTPXYLabelsGeneratorMixin::setXDateTimeFormmat(const QString &v)
|
||||
void JKQTPXYLabelsGeneratorMixin::setXDateTimeFormat(const QString &v)
|
||||
{
|
||||
m_xDateTimeFormat=v;
|
||||
}
|
||||
|
||||
QString JKQTPXYLabelsGeneratorMixin::getYDateTimeFormmat() const
|
||||
QString JKQTPXYLabelsGeneratorMixin::getYDateTimeFormat() const
|
||||
{
|
||||
return m_yDateTimeFormat;
|
||||
}
|
||||
|
||||
void JKQTPXYLabelsGeneratorMixin::setYDateTimeFormmat(const QString &v)
|
||||
void JKQTPXYLabelsGeneratorMixin::setYDateTimeFormat(const QString &v)
|
||||
{
|
||||
m_yDateTimeFormat=v;
|
||||
}
|
||||
|
@ -384,14 +384,14 @@ public:
|
||||
|
||||
|
||||
|
||||
/** \copydoc m_xDateTimeFormmat */
|
||||
QString getXDateTimeFormmat() const;
|
||||
/** \copydoc m_xDateTimeFormmat */
|
||||
void setXDateTimeFormmat(const QString& v);
|
||||
/** \copydoc m_yDateTimeFormmat */
|
||||
QString getYDateTimeFormmat() const;
|
||||
/** \copydoc m_yDateTimeFormmat */
|
||||
void setYDateTimeFormmat(const QString& v);
|
||||
/** \copydoc m_xDateTimeFormat */
|
||||
QString getXDateTimeFormat() const;
|
||||
/** \copydoc m_xDateTimeFormat */
|
||||
void setXDateTimeFormat(const QString& v);
|
||||
/** \copydoc m_yDateTimeFormat */
|
||||
QString getYDateTimeFormat() const;
|
||||
/** \copydoc m_yDateTimeFormat */
|
||||
void setYDateTimeFormat(const QString& v);
|
||||
|
||||
|
||||
protected:
|
||||
@ -405,7 +405,7 @@ protected:
|
||||
QString xValToString(double x) const;
|
||||
/** \brief converts \a y to a string, using several of the formatting properties set in this class for y-values */
|
||||
QString yValToString(double y) const;
|
||||
/** \rief converts \a x to a QString, using the provided options */
|
||||
/** \brief converts \a x to a QString, using the provided options */
|
||||
static QString valToString(double x, JKQTPGraphLabelConverterType m_xDefaultConverter, int m_xDefaultPrecision, double m_xBelowIsZero, double m_xMinNoExponent, double m_xMaxNoExponent, const QString& m_xDateTimeFormat);
|
||||
private:
|
||||
/** \brief format string for the x-label, use \c %1 as placeholder for the numeric value */
|
||||
|
@ -1996,7 +1996,7 @@ JKQTPLOTTER_LIB_EXPORT JKQTPXFunctionLineGraph* jkqtpstatAddLinearWeightedRegres
|
||||
jkqtpstatRegression(plot1->getPlotter(), JKQTPStatRegressionModelType::Exponential, datastore1->begin(colLinX), datastore1->end(colLinX), datastore1->begin(colLinY), datastore1->end(colLinY));
|
||||
\endcode
|
||||
|
||||
\image html datastore_regression_nonlinreg.png
|
||||
\image html datastore_regression_nonlinreg_exp.png
|
||||
|
||||
\see \ref JKQTPlotterBasicJKQTPDatastoreRegression, jkqtpstatRegression()
|
||||
*/
|
||||
@ -2038,7 +2038,7 @@ inline JKQTPXFunctionLineGraph* jkqtpstatAddRegression(JKQTBasePlotter* plotter,
|
||||
jkqtpstatRegression(graphD, JKQTPStatRegressionModelType::Exponential);
|
||||
\endcode
|
||||
|
||||
\image html datastore_regression_nonlinreg.png
|
||||
\image html datastore_regression_nonlinreg_exp.png
|
||||
|
||||
\note The line graph is added to the same plotter that is the parent of \a datagraph !
|
||||
|
||||
|
@ -317,15 +317,15 @@ public:
|
||||
virtual bool usesColumn(int c) const override;
|
||||
|
||||
|
||||
/** \copydoc colorColumn */
|
||||
/** \copydoc m_colorColumn */
|
||||
void setColorColumn(int __value);
|
||||
/** \copydoc colorColumn */
|
||||
/** \copydoc m_colorColumn */
|
||||
int getColorColumn() const;
|
||||
/** \copydoc colorColumn */
|
||||
/** \copydoc m_colorColumn */
|
||||
void setColorColumn (size_t __value);
|
||||
/** \copydoc colorColumnContainsRGB */
|
||||
/** \copydoc m_colorColumnContainsRGB */
|
||||
void setColorColumnContainsRGB(bool __value);
|
||||
/** \copydoc colorColumnContainsRGB */
|
||||
/** \copydoc m_colorColumnContainsRGB */
|
||||
bool getColorColumnContainsRGB() const;
|
||||
/** \copydoc m_vectorColorMode */
|
||||
void setVectorColorMode(VectorColorMode __value);
|
||||
|
@ -1206,7 +1206,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotter: public QObject {
|
||||
|
||||
/** \brief adds a secondary x-axis
|
||||
*
|
||||
* \params axis the JKQTPHorizontalAxisBase object to add
|
||||
* \param axis the JKQTPHorizontalAxisBase object to add
|
||||
* \returns a reference to this axis
|
||||
*
|
||||
* Usage is simple:
|
||||
@ -1231,7 +1231,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotter: public QObject {
|
||||
JKQTPCoordinateAxisRef addSecondaryXAxis(JKQTPHorizontalAxisBase* axis);
|
||||
/** \brief adds a secondary y-axis
|
||||
*
|
||||
* \params axis the JKQTPVerticalAxisBase object to add
|
||||
* \param axis the JKQTPVerticalAxisBase object to add
|
||||
* \returns a reference to this axis
|
||||
*
|
||||
* Usage is simple:
|
||||
@ -1663,8 +1663,8 @@ public Q_SLOTS:
|
||||
*
|
||||
* \param filename name of the stored file, if no \a outputFormat is given, the file format is deduced by the file extension in \a filename
|
||||
* \param displayPreview if \c true a dialog is shown that allows to modify the generated output (zoo, scaling, ...)
|
||||
* \param outputFormmat specify the file format for the generated file
|
||||
* \param outputSizeIncrease if given, the size of the generated pixel image is increased by this number of pixels in addition to the required space
|
||||
* \param outputFormat specify the file format for the generated file
|
||||
* \param outputSizeIncrease if given, the size of the generated pixel image is increased by this number of pixels in addition to the required space
|
||||
* \return returns \c true on success
|
||||
*
|
||||
* This function may generate any pixel-graphics format, supported by Qt and listed in <a href="https://doc.qt.io/qt-6/qimagewriter.html"><code>QImageWriter::supportedImageFormats()</code></a>.
|
||||
@ -1686,7 +1686,7 @@ public Q_SLOTS:
|
||||
/** \brief save the current plot as a SVG file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed
|
||||
*
|
||||
* \param filename the filename to save to, if empty a file save dialog is displayed
|
||||
* \param displayPreview if \C true, a save/print-preview dialog is displayed that allows to make some modifications to the generated image, otherwise the image is saved with default settings.
|
||||
* \param displayPreview if \c true, a save/print-preview dialog is displayed that allows to make some modifications to the generated image, otherwise the image is saved with default settings.
|
||||
* \return Returns \c true if the file was save successfully
|
||||
*
|
||||
* \note Exporting to SVG requires QPrinter-support, if it is not available on your platform, this function will not be available either!
|
||||
@ -1696,7 +1696,7 @@ public Q_SLOTS:
|
||||
/** \brief save the current plot as a PDF file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed
|
||||
*
|
||||
* \param filename the filename to save to, if empty a file save dialog is displayed
|
||||
* \param displayPreview if \C true, a save/print-preview dialog is displayed that allows to make some modifications to the generated image, otherwise the image is saved with default settings.
|
||||
* \param displayPreview if \c true, a save/print-preview dialog is displayed that allows to make some modifications to the generated image, otherwise the image is saved with default settings.
|
||||
* \return Returns \c true if the file was save successfully
|
||||
*
|
||||
* \note Exporting to PDF requires QPrinter-support, if it is not available on your platform, this function will not be available either!
|
||||
@ -1708,7 +1708,7 @@ public Q_SLOTS:
|
||||
* The image format is extracted from the file extension (jpeg, tiff, png, pdf, ...)
|
||||
*
|
||||
* \param filename the filename to save to, if empty a file save dialog is displayed
|
||||
* \param displayPreview if \C true, a save/print-preview dialog is displayed that allows to make some modifications to the generated image, otherwise the image is saved with default settings.
|
||||
* \param displayPreview if \c true, a save/print-preview dialog is displayed that allows to make some modifications to the generated image, otherwise the image is saved with default settings.
|
||||
* \return Returns \c true if the file was save successfully
|
||||
*
|
||||
* This function is comparable to saveAsPixelImage(), but it allows to save into any graphics format, including SVG and PF (if printer-support is compiled into the library).
|
||||
|
@ -217,7 +217,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPBaseKey: public QObject {
|
||||
inline Qt::PenStyle getFrameLineStyle() const { return keyStyle().frameLineStyle; }
|
||||
/** \copydoc JKQTPKeyStyle::textColor */
|
||||
inline QColor getTextColor() const { return keyStyle().textColor; }
|
||||
/** \copydoc JKQTPKeyStyle::backgroundColor */
|
||||
/** \copydoc JKQTPKeyStyle::backgroundBrush */
|
||||
inline QColor getBackgroundColor() const { return keyStyle().backgroundBrush.color(); }
|
||||
/** \copydoc JKQTPKeyStyle::backgroundBrush */
|
||||
inline const QBrush& getBackgroundBrush() const { return keyStyle().backgroundBrush; }
|
||||
@ -266,9 +266,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPBaseKey: public QObject {
|
||||
inline void setFrameLineStyle(Qt::PenStyle __value) { keyStyle().frameLineStyle = __value; redrawPlot(); }
|
||||
/** \copydoc JKQTPKeyStyle::textColor */
|
||||
inline void setTextColor(QColor __value) { keyStyle().textColor = __value; redrawPlot(); }
|
||||
/** \copydoc JKQTPKeyStyle::backgroundColor */
|
||||
/** \copydoc JKQTPKeyStyle::backgroundBrush */
|
||||
inline void setBackgroundColor(QColor __value) { keyStyle().backgroundBrush = __value; redrawPlot(); }
|
||||
/** \copydoc JKQTPKeyStyle::backgroundColor */
|
||||
/** \copydoc JKQTPKeyStyle::backgroundBrush */
|
||||
inline void setBackgroundColor(QColor __value, Qt::BrushStyle __style) { keyStyle().backgroundBrush = QBrush(__value, __style); redrawPlot(); }
|
||||
/** \copydoc JKQTPKeyStyle::backgroundBrush */
|
||||
inline void setBackgroundBrush(const QBrush& __value) { keyStyle().backgroundBrush = __value; redrawPlot(); }
|
||||
|
@ -922,8 +922,8 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPlotter: public QWidget {
|
||||
/** \copydoc JKQTBasePlotter::zoom()
|
||||
* \deprecated The function JKQTPlotter::zoom() is deprecated and will be removed in future version, use JKQTPlotter::setXY() instead!
|
||||
*/
|
||||
inline void zoom(double nxmin, double nxmax, double nymin, double nymax, bool affectsSecondaryAxes=false) {
|
||||
plotter->zoom(nxmin, nxmax, nymin, nymax, affectsSecondaryAxes);
|
||||
inline void zoom(double xminn, double xmaxn, double yminn, double ymaxn, bool affectsSecondaryAxes=false) {
|
||||
plotter->zoom(xminn, xmaxn, yminn, ymaxn, affectsSecondaryAxes);
|
||||
}
|
||||
|
||||
/** \copydoc JKQTBasePlotter::setGrid() */
|
||||
|
BIN
screenshots/screen_parmetrizedplots_datatable.png
Normal file
BIN
screenshots/screen_parmetrizedplots_datatable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
Loading…
Reference in New Issue
Block a user