21 const Color
COLOR_ON(255, 255, 255, 255);
50 void set_width(uint32_t width) { this->width_ = width; }
51 void set_height(uint32_t height) { this->height_ = height; }
91 void take_sample(
float data);
93 float get_value(
int idx)
const {
return samples_[(count_ + length_ - 1 - idx) % length_]; }
100 uint32_t update_time_{0};
103 float recent_min_{NAN};
104 float recent_max_{NAN};
115 enum LineType get_line_type() {
return this->line_type_; }
126 std::string name_{
""};
127 uint8_t line_thickness_{3};
130 bool continuous_{
false};
142 void setup()
override;
144 void dump_config()
override;
158 this->legend_ = legend;
169 float min_value_{NAN};
170 float max_value_{NAN};
171 float min_range_{1.0};
172 float max_range_{NAN};
173 float gridspacing_x_{NAN};
174 float gridspacing_y_{NAN};
const HistoryData * get_tracedata()
float get_value(int idx) const
void set_line_color(Color val)
void set_height(uint32_t height)
void set_grid_x(float val)
void add_trace(GraphTrace *trace)
void set_max_value(float val)
float get_setup_priority() const override
void set_direction(DirectionType val)
float get_recent_min() const
void set_border(bool val)
void set_value_font(display::BaseFont *font)
void set_name(std::string name)
std::vector< GraphTrace * > traces_
void set_continuous(bool continuous)
std::vector< float > samples_
void init(Graph *g)
Determine the best coordinates of drawing text + lines.
const float PROCESSOR
For components that use data from sensors like displays.
void set_grid_y(float val)
void set_line_type(enum LineType val)
void set_line_thickness(uint8_t val)
const Color COLOR_ON(255, 255, 255, 255)
Turn the pixel ON.
void add_legend(GraphLegend *legend)
uint8_t get_line_thickness()
void set_update_time_ms(uint32_t update_time_ms)
void set_duration(uint32_t duration)
void set_sensor(sensor::Sensor *sensor)
Implementation of SPI Controller mode.
void set_width(uint32_t width)
LineType
Bit pattern defines the line-type.
void set_border(bool val)
void set_name_font(display::BaseFont *font)
uint32_t height_
in pixels
Base-class for all sensors.
void set_min_range(float val)
void set_min_value(float val)
float get_recent_max() const
uint32_t width_
in seconds
esphome::sensor::Sensor * sensor
void set_width(uint32_t width)
void set_height(uint32_t height)
void set_values(ValuePositionType val)
void set_max_range(float val)