mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/stats] Display only one axis in box view
This commit is contained in:
@@ -13,7 +13,8 @@ BoxView::BoxView(Store * store, int series, Shared::BannerView * bannerView, Qua
|
||||
m_labels{},
|
||||
m_series(series),
|
||||
m_selectedQuantile(selectedQuantile),
|
||||
m_selectedHistogramColor(color)
|
||||
m_selectedHistogramColor(color),
|
||||
m_displayAxis(true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -43,8 +44,12 @@ void BoxView::reload() {
|
||||
|
||||
void BoxView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ctx->fillRect(rect, KDColorWhite);
|
||||
drawAxes(ctx, rect, Axis::Horizontal);
|
||||
drawLabels(ctx, rect, Axis::Horizontal, false);
|
||||
if (m_displayAxis) {
|
||||
drawAxes(ctx, rect, Axis::Horizontal);
|
||||
drawLabels(ctx, rect, Axis::Horizontal, false);
|
||||
}
|
||||
|
||||
// TODO : recompute drawing position without axis
|
||||
float lowBound = 0.35f;
|
||||
float upBound = 0.65f;
|
||||
double minVal = m_store->minValue(m_series);
|
||||
|
||||
@@ -23,6 +23,7 @@ public:
|
||||
Quantile selectedQuantile() const { return *m_selectedQuantile; }
|
||||
bool selectQuantile(int selectedQuantile);
|
||||
int series() const { return m_series; }
|
||||
void setDisplayAxis(bool display) { m_displayAxis = display; }
|
||||
|
||||
// CurveView
|
||||
void reload() override;
|
||||
@@ -37,6 +38,7 @@ private:
|
||||
int m_series;
|
||||
Quantile * m_selectedQuantile;
|
||||
KDColor m_selectedHistogramColor;
|
||||
bool m_displayAxis;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ MultipleBoxesView::MultipleBoxesView(Store * store, BoxView::Quantile * selected
|
||||
for (int i = 0; i < Store::k_numberOfSeries; i++) {
|
||||
BoxView * boxView = dataViewAtIndex(i);
|
||||
boxView->setDisplayBannerView(false);
|
||||
//histView->setDisplayLabels(false); //TODO
|
||||
boxView->setDisplayAxis(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,4 +31,13 @@ int MultipleBoxesView::seriesOfSubviewAtIndex(int index) {
|
||||
return static_cast<BoxView *>(subviewAtIndex(index))->series();
|
||||
}
|
||||
|
||||
void MultipleBoxesView::layoutSubviews() {
|
||||
MultipleDataView::layoutSubviews();
|
||||
int numberOfDataSubviews = numberOfSubviews() - 1;
|
||||
assert(numberOfDataSubviews > 0);
|
||||
for (int i = 0; i < numberOfDataSubviews; i++) {
|
||||
static_cast<BoxView *>(subviewAtIndex(i))->setDisplayAxis(i == numberOfDataSubviews - 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ public:
|
||||
int seriesOfSubviewAtIndex(int index) override;
|
||||
const BoxBannerView * bannerView() const override { return &m_bannerView; }
|
||||
BoxView * dataViewAtIndex(int index) override;
|
||||
void layoutSubviews() override;
|
||||
private:
|
||||
BoxView m_boxView1;
|
||||
BoxView m_boxView2;
|
||||
|
||||
Reference in New Issue
Block a user