mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-27 01:29:58 +01:00
[apps/stats] Display multiple boxes
This commit is contained in:
34
apps/statistics/multiple_boxes_view.cpp
Normal file
34
apps/statistics/multiple_boxes_view.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "multiple_boxes_view.h"
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Shared;
|
||||
|
||||
namespace Statistics {
|
||||
|
||||
MultipleBoxesView::MultipleBoxesView(Store * store, BoxView::Quantile * selectedQuantile) :
|
||||
MultipleDataView(store),
|
||||
m_boxView1(store, 0, nullptr, selectedQuantile, Palette::Red),
|
||||
m_boxView2(store, 1, nullptr, selectedQuantile, Palette::Blue),
|
||||
m_boxView3(store, 2, nullptr, selectedQuantile, Palette::Green),
|
||||
// TODO Share colors with stats/store_controller
|
||||
m_bannerView()
|
||||
{
|
||||
for (int i = 0; i < Store::k_numberOfSeries; i++) {
|
||||
BoxView * boxView = dataViewAtIndex(i);
|
||||
boxView->setDisplayBannerView(false);
|
||||
//histView->setDisplayLabels(false); //TODO
|
||||
}
|
||||
}
|
||||
|
||||
BoxView * MultipleBoxesView::dataViewAtIndex(int index) {
|
||||
assert(index >= 0 && index < 3);
|
||||
BoxView * views[] = {&m_boxView1, &m_boxView2, &m_boxView3};
|
||||
return views[index];
|
||||
}
|
||||
|
||||
int MultipleBoxesView::seriesOfSubviewAtIndex(int index) {
|
||||
assert(index >= 0 && index < numberOfSubviews() - 1);
|
||||
return static_cast<BoxView *>(subviewAtIndex(index))->series();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user