bugfix in JKQTPfilledCurveYGraph and example for JKQTPfilledCurveYGraph

This commit is contained in:
jkriege2 2018-12-11 00:05:21 +01:00
parent 49bac25809
commit 5e0471d0eb
3 changed files with 5 additions and 1 deletions

View File

@ -340,7 +340,7 @@ void JKQTPfilledCurveYGraph::draw(JKQTPEnhancedPainter& painter) {
} else { } else {
if (xok&&yok) { if (xok&&yok) {
if (drawLine) pl.moveTo(x,y); if (drawLine) pl.moveTo(x,y);
pf.moveTo(x, y0); pf.moveTo(x0, y);
pf.lineTo(x, y); pf.lineTo(x, y);
//xold=x; //xold=x;
yold=y; yold=y;

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -74,6 +74,10 @@ The result looks like this:
![jkqtplotter_simpletest_filledgraphs](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_filledgraphs.png) ![jkqtplotter_simpletest_filledgraphs](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_filledgraphs.png)
If you use `JKQTPfilledCurveYGraph` instead of `JKQTPfilledCurveXGraph`, the curve will not be filled until the y=0-axis, but until the x=0-axis. Of course you will also have to swap the x- and y-data columns. The result will look like this:
![jkqtplotter_simpletest_filledgraphs_yaxis](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_filledgraphs_yaxis.png)
[Back to JKQTPlotter main page](https://github.com/jkriege2/JKQtPlotter/) [Back to JKQTPlotter main page](https://github.com/jkriege2/JKQtPlotter/)