35 static const float AutoMin;
36 static const float AutoMax;
49 float calcScaling(
int length,
float &min_val,
float &max_val)
51 if(min_val == max_val)
63 return length/(max_val-min_val);
65 void setScalingX(
int dc_offset,
int length,
float min_val,
float max_val)
67 _scale_x=calcScaling(length,min_val,max_val);
69 _dc_start_x=dc_offset;
75 void setScalingY(
int dc_offset,
int length,
float min_val,
float max_val)
77 _scale_y=calcScaling(length,min_val,max_val);
83 _dc_start_y=dc_offset;
98 return _dc_start_x+(x-_offset_x)*_scale_x;
103 return _dc_start_y-(y-_offset_y)*_scale_y;
116 if(y<_min_y || y> _max_y || _last_y<_min_y || _last_y> _max_y)
132 const float ChartDC::AutoMin = 1e-8;
133 const float ChartDC::AutoMax = 1e8;
float LCtoDC_x(float x)
Converts logic x into window x.
Definition: ChartDC.h:96
Device context for chart window. Implement transformation of logic coordinates into window coordinate...
Definition: ChartDC.h:23
ChartDC()
Constructor.
Definition: ChartDC.h:38
Device context. Abstraction layer to the device specific drawing code. Coordinates in drawing functio...
Definition: DC.h:29
void MoveTo(DC *dc, float x, float y)
Moves actual position in logic coordinates.
Definition: ChartDC.h:106
float LCtoDC_y(float y)
Converts logic y into window y.
Definition: ChartDC.h:101
void LineTo(DC *dc, float x, float y)
Draws line from actual position to the new position.
Definition: ChartDC.h:114