Bar
Namespace: DISPLIB · Library: Display Library
#include <disp/bar.h>
class DISPLIB::Bar
Bar chart / histogram QWidget rendering Eigen class-limit + frequency vectors with QPainter.
Templated on the value type so callers can pass either integer or floating bin limits. Use setData to install a new dataset and updatePlot to refresh an existing chart in place; both call splitCoefficientAndExponent internally to format the tick labels with a configurable number of significant digits.
Inheritance
Public Methods
Bar(title, parent)
The constructor for Bar.
setData(matClassLimitData, matClassFrequencyData, iPrecisionValue)
Sets new data to the bar chart.
Parameters:
-
matClassLimitData : const Eigen::Matrix< T, Eigen::Dynamic, 1 > & vector input filled with class limits.
-
matClassFrequencyData : const Eigen::Matrix< int, Eigen::Dynamic, 1 > & vector input filled with class frequency to the corresponding class.
-
iPrecisionValue : int user input to determine the amount of digits of coefficient shown in the histogram.
setData(matClassLimitData, matClassFrequencyData, iPrecisionValue)
updatePlot(matClassLimitData, matClassFrequencyData, iPrecisionValue)
Updates the bar plot with the new data.
Parameters:
-
matClassLimitData : const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & vector input filled with class limits.
-
matClassFrequencyData : const Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic > & vector input filled with class frequency to the corresponding class.
-
iPrecisionValue : int user input to determine the amount of digits of coefficient shown in the histogram.
splitCoefficientAndExponent(matClassLimitData, iClassAmount, vecCoefficientResults, vecExponentValues)
splitCoefficientAndExponent takes in QVector value of coefficient and exponent and normalizes them.
Parameters:
-
matClassLimitData : const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & vector input filled with values of class limits.
-
iClassAmount : int amount of classes in the histogram.
-
vecCoefficientResults : Eigen::VectorXd & vector filled with values of coefficient only.
-
vecExponentValues : Eigen::VectorXi & vector filled with values of exponent only.
Authors of this file
- Lorenz Esch <lorenz.esch@tu-ilmenau.de>
- Juan GPC <jgarciaprieto@mgh.harvard.edu>
- Andreas Griesshammer <ag@fieldlineinc.com>
- Gabriel Motta <gabrielbenmotta@gmail.com>
- Christoph Dinh <christoph.dinh@mne-cpp.org>