4 #include <unordered_map>
11 namespace datastructure {
17 std::string plotTitle;
18 std::string plotSubTitle;
19 std::string tooltipSuffix;
20 std::string alignment;
22 unordered_map<string, vector<double>> seriesData;
23 std::vector<std::string> seriesBins;
32 alignment =
"horizontal";
124 tooltipSuffix = suffix;
128 return tooltipSuffix;
143 seriesData[seriesName] = data;
148 std::string bins =
"";
150 for (
auto& entry : seriesBins) {
153 bins = bins.erase(bins.length() - 1);
156 std::string series =
"";
158 for (
auto& entry : seriesData) {
160 std::string key = entry.first;
161 std::vector<double> value = entry.second;
164 for (
int i = 0; i < value.size(); i++) {
167 series = series.erase(series.length() - 1);
170 series = series.erase(series.length() - 1);
Definition: BarChart.h:13
void setBinsLabel(std::string xaxisName)
Change the label for the X-axis.
Definition: BarChart.h:102
BarChart()
Definition: BarChart.h:26
std::string getBinsLabel() const
Returns the label for the Y-axis.
Definition: BarChart.h:111
std::string getTitle() const
Title of the plot.
Definition: BarChart.h:57
std::string getBarAlignment() const
Definition: BarChart.h:119
void setSubTitle(std::string s)
Subtitle of the plot.
Definition: BarChart.h:66
void setSeriesLabel(std::string yaxisName)
Change the label for the Y-axis.
Definition: BarChart.h:84
void setSeriesBins(std::vector< std::string > bins)
Definition: BarChart.h:131
std::string getSubTitle() const
Subtitle of the plot.
Definition: BarChart.h:75
void setTooltipSuffix(std::string suffix)
Definition: BarChart.h:123
std::string getSeriesLabel() const
Returns the label for the Y-axis.
Definition: BarChart.h:93
virtual const std::string getDataStructureRepresentation() const override
Definition: BarChart.h:146
void addDataSeries(std::string seriesName, std::vector< double > data)
Add a series (or update it)
Definition: BarChart.h:142
void setTitle(std::string t)
Title of the plot.
Definition: BarChart.h:48
std::string getTooltipSuffix() const
Definition: BarChart.h:127
void setBarAlignment(std::string align)
Definition: BarChart.h:115
virtual const string getDStype() const override
Get the data type.
Definition: BarChart.h:39
This is the superclass of all data structure types in BRIDGES.
Definition: DataStructure.h:73
std::string JSONencode(const T &d)
Definition: JSONutil.h:36
these methods convert byte arrays in to base64 codes and are used in BRIDGES to represent the color a...
Definition: alltypes.h:4
const string COLON
Definition: DataStructure.h:51
const string OPEN_BOX
Definition: DataStructure.h:54
const string COMMA
Definition: DataStructure.h:50
const string OPEN_CURLY
Definition: DataStructure.h:52
const string CLOSE_BOX
Definition: DataStructure.h:55
const string CLOSE_CURLY
Definition: DataStructure.h:53