20#ifndef jkqtpfinancial_H
21#define jkqtpfinancial_H
26#include "jkqtplotter/jkqtptools.h"
27#include "jkqtplotter/jkqtplotter_imexport.h"
28#include "jkqtplotter/jkqtpgraphsbase.h"
29#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
100 Q_ENUM(FinancialGraphType)
143 virtual
bool getYMinMax(
double& miny,
double& maxy,
double& smallestGreaterZero) override;
196 virtual
void setColor(QColor cPositive, QColor cNegative);
204 virtual
void setColor(QColor linePositive, QColor fillPositive, QColor lineNegative, QColor fillNegative);
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
virtual QColor getKeyLabelColor() const override
returns the color to be used for the key label
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
void setGraphType(FinancialGraphType __value)
type of the financial graph (OHLC or candle-stick)
static QSet< JKQTBasePlotter * > parentsAlreadySeen
Definition jkqtpfinancial.h:264
double getWidth() const
the width of the boxes, relative to the distance between the current and the next x-value
int lowColumn
column for the "Low" value of the financial graph
Definition jkqtpfinancial.h:166
JKQTPGraphFillStyleMixin m_fillStyleNegative
fill style for negative items (close<open)
Definition jkqtpfinancial.h:312
void setOpenColumn(int __value)
column for the "Open" value of the financial graph
void setWidth(double __value)
the width of the boxes, relative to the distance between the current and the next x-value
JKQTPFinancialGraph(JKQTBasePlotter *parent=nullptr)
class constructor
virtual bool getIndexRange(int &imin, int &imax) const override
determines the range of row indexes available in the data columns of this graph
void setOHLCTwoColor(QColor cPositive, QColor cNegative)
sets graphType = FinancialGraphType::OHLC and sets the positive and negative color (for fill and line...
JKQTPGraphFillStyleMixin m_fillStylePositive
fill style for positive items (close>open)
Definition jkqtpfinancial.h:307
void setCandlestickOneColor(QColor cLine)
sets graphType = FinancialGraphType::CandleStick and sets one color cLine for positive and negative i...
double shift
the shift of the boxes, relative to the distance between the current and the next x-value
Definition jkqtpfinancial.h:302
int getOpenColumn() const
column for the "Open" value of the financial graph
void autoscaleBoxWidthAndShiftSeparatedGroups(double groupWidth=0.65)
equivalent to autoscaleBoxWidthAndShift(groupWidth,0.8);
int getLowColumn() const
column for the "Low" value of the financial graph
void setCandlestickTwoColor(QColor cPositive, QColor cNegative)
sets graphType = FinancialGraphType::CandleStick and sets the positive and negative color (for fill a...
virtual bool usesColumn(int column) const override
returns true if the given column is used by the graph
double width
the width of the boxes, relative to the distance between the current and the next x-value
Definition jkqtpfinancial.h:296
double getShift() const
the shift of the boxes, relative to the distance between the current and the next x-value
void setLowColumn(int __value)
column for the "Low" value of the financial graph
static void clearColorAssignStore()
JKQTPGraphLineStyleMixin & lineStyleNegative()
fill style for negative items (close<open)
JKQTPGraphFillStyleMixin & fillStyleNegative()
fill style for negative items (close<open)
JKQTPGraphLineStyleMixin m_lineStyleNegative
fill style for negative items (close<open)
Definition jkqtpfinancial.h:322
FinancialGraphType graphType
type of the financial graph (OHLC or candle-stick)
Definition jkqtpfinancial.h:167
void setShift(double __value)
the shift of the boxes, relative to the distance between the current and the next x-value
JKQTPGraphLineStyleMixin & lineStylePositive()
fill style for positive items (close>open)
virtual void autoscaleBoxWidthAndShift(double maxWidth=0.8, double shrinkFactor=0.8)
finds all financial charts of the same orientation and determines width and shift,...
virtual void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect) override
plots a key marker inside the specified rectangle rect
virtual bool considerForAutoscaling(JKQTPFinancialGraph *other) const
this function is used by autoscaleBoxWidthAndShift() to determine whether a given graph shall be take...
FinancialGraphType
types of financial graphs that can be drawn by this class
Definition jkqtpfinancial.h:96
@ CandleStick
candlestick graphs
Definition jkqtpfinancial.h:97
@ OHLC
OHLC (Open-High-Low-Close) graphs.
Definition jkqtpfinancial.h:98
int highColumn
column for the "High" value of the financial graph
Definition jkqtpfinancial.h:165
void setHighColumn(int __value)
column for the "High" value of the financial graph
void setCloseColumn(int __value)
column for the "Close" value of the financial graph
int getHighColumn() const
column for the "High" value of the financial graph
int openColumn
column for the "Open" value of the financial graph
Definition jkqtpfinancial.h:163
JKQTPGraphLineStyleMixin m_lineStylePositive
fill style for positive items (close>open)
Definition jkqtpfinancial.h:317
virtual void setColor(QColor cPositive, QColor cNegative)
set outline and fill color at the same time, for both positive and negative boxes
FinancialGraphType getGraphType() const
type of the financial graph (OHLC or candle-stick)
int closeColumn
column for the "Close" value of the financial graph
Definition jkqtpfinancial.h:164
JKQTPGraphFillStyleMixin & fillStylePositive()
fill style for positive items (close>open)
int getCloseColumn() const
column for the "Close" value of the financial graph
This Mix-In class provides setter/getter methods, storage and other facilities for the graph filling ...
Definition jkqtpgraphsbasestylingmixins.h:529
This Mix-In class provides setter/getter methods, storage and other facilities for the graph line sty...
Definition jkqtpgraphsbasestylingmixins.h:49
JKQTBasePlotter * parent
the plotter object this object belongs to
Definition jkqtpgraphsbase.h:386
JKQTPXGraph(JKQTBasePlotter *parent=nullptr)
class constructor
plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing)
Definition jkqtplotter.h:374
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89