Blame view

build3/apps/statistics/box_view.h 936 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  #ifndef STATISTICS_BOX_VIEW_H
  #define STATISTICS_BOX_VIEW_H
  
  #include <escher.h>
  #include "store.h"
  #include "box_range.h"
  #include "../constant.h"
  #include "../shared/curve_view.h"
  
  namespace Statistics {
  
  class BoxView : public Shared::CurveView {
  public:
    enum class Quantile : int {
      None = -1,
      Min = 0,
      FirstQuartile = 1,
      Median = 2,
      ThirdQuartile = 3,
      Max = 4
    };
    BoxView(Store * store, Shared::BannerView * bannerView, Quantile * selectedQuantile);
    void reload() override;
    Quantile selectedQuantile();
    bool selectQuantile(int selectedQuantile);
    void drawRect(KDContext * ctx, KDRect rect) const override;
  private:
    char * label(Axis axis, int index) const override;
    Store * m_store;
    BoxRange m_boxRange;
    char m_labels[k_maxNumberOfXLabels][Poincare::PrintFloat::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
    Quantile * m_selectedQuantile;
  };
  
  }
  
  
  #endif