JKQTPlotter/JKQTBasePlotter: added functions to set properties of all grid lines (x+y axis) together

This commit is contained in:
jkriege2 2019-06-16 13:27:02 +02:00
parent 9e4210c823
commit f96e262371
3 changed files with 96 additions and 0 deletions

View File

@ -306,6 +306,41 @@ void JKQTBasePlotter::setGrid(bool val) {
yAxis->setDrawGrid(val); yAxis->setDrawGrid(val);
} }
void JKQTBasePlotter::setGridColor(QColor color)
{
xAxis->setGridColor(color);
yAxis->setGridColor(color);
}
void JKQTBasePlotter::setMinorGridColor(QColor color)
{
xAxis->setMinorGridColor(color);
yAxis->setMinorGridColor(color);
}
void JKQTBasePlotter::setGridWidth(double __value)
{
xAxis->setGridWidth(__value);
yAxis->setGridWidth(__value);
}
void JKQTBasePlotter::setMinorGridWidth(double __value)
{
xAxis->setMinorGridWidth(__value);
yAxis->setMinorGridWidth(__value);
}
void JKQTBasePlotter::setGridStyle(Qt::PenStyle __value)
{
xAxis->setGridStyle(__value);
yAxis->setGridStyle(__value);
}
void JKQTBasePlotter::setMinorGridStyle(Qt::PenStyle __value)
{
xAxis->setMinorGridStyle(__value);
yAxis->setMinorGridStyle(__value);
}
void JKQTBasePlotter::setShowZeroAxes(bool showX, bool showY) { void JKQTBasePlotter::setShowZeroAxes(bool showX, bool showY) {
getXAxis()->setShowZeroAxis(showX); getXAxis()->setShowZeroAxis(showX);
getYAxis()->setShowZeroAxis(showY); getYAxis()->setShowZeroAxis(showY);

View File

@ -1434,6 +1434,31 @@ class JKQTP_LIB_EXPORT JKQTBasePlotter: public QObject {
/** \brief sets whether to plot grid lines or not */ /** \brief sets whether to plot grid lines or not */
void setGrid(bool val); void setGrid(bool val);
/** \brief sets the color of all Major grid lines
* */
void setGridColor(QColor color);
/** \brief sets the color of all minor grid lines
* */
void setMinorGridColor(QColor color);
/** \brief sets the width of all Major grid lines
* */
void setGridWidth(double __value);
/** \brief sets the width of all minor grid lines
* */
void setMinorGridWidth(double __value);
/** \brief sets the style of all Major grid lines
* */
void setGridStyle(Qt::PenStyle __value);
/** \brief sets the style of all minor grid lines
* */
void setMinorGridStyle(Qt::PenStyle __value);
/** \brief switches the visibility of the zero-axes associated with the x- and y-axis /** \brief switches the visibility of the zero-axes associated with the x- and y-axis
* *
* \param showX indicates whether to show the zero-axis associated with the x-axis (i.e. x==0 or the vertical zero-axis) * \param showX indicates whether to show the zero-axis associated with the x-axis (i.e. x==0 or the vertical zero-axis)

View File

@ -926,6 +926,42 @@ class JKQTP_LIB_EXPORT JKQTPlotter: public QWidget {
plotter->setGrid(val); plotter->setGrid(val);
} }
/** \brief sets the color of all Major grid lines
* */
inline void setGridColor(QColor color) {
plotter->setGridColor(color);
}
/** \brief sets the color of all minor grid lines
* */
inline void setMinorGridColor(QColor color) {
plotter->setMinorGridColor(color);
}
/** \brief sets the width of all Major grid lines
* */
inline void setGridWidth(double __value) {
plotter->setGridWidth(__value);
}
/** \brief sets the width of all minor grid lines
* */
inline void setMinorGridWidth(double __value) {
plotter->setMinorGridWidth(__value);
}
/** \brief sets the style of all Major grid lines
* */
inline void setGridStyle(Qt::PenStyle __value) {
plotter->setGridStyle(__value);
}
/** \brief sets the style of all minor grid lines
* */
inline void setMinorGridStyle(Qt::PenStyle __value) {
plotter->setMinorGridStyle(__value);
}
/** \brief switches the visibility of the zero-axes associated with the x- and y-axis /** \brief switches the visibility of the zero-axes associated with the x- and y-axis
* *
* \param showX indicates whether to show the zero-axis associated with the x-axis (i.e. x==0 or the vertical zero-axis) * \param showX indicates whether to show the zero-axis associated with the x-axis (i.e. x==0 or the vertical zero-axis)