#include "ScatterCtrl_Demo.h" void Tab6_Logarithmic::Init() { CtrlLayout(*this); SizePos(); scatter.SetRange(6,100); scatter.SetMajorUnits(1,20); scatter.ShowInfo(); scatter.SetMouseHandling(false, false); s1 <= 1 && val <= 1e5) s = FormatDoubleExp(val, 0); } void Tab6_Logarithmic::FormatXGridUnits(String& s, int i, double d) { double val = pow(10, d); int valint = fround(val); if (abs(val - double(valint)) < 0.0001) { while (valint < -9 || valint > 9) valint /= 10; if (valint == 1) s = FormatDoubleExp(pow(10, d), 0); } } void Tab6_Logarithmic::SetGridLinesX(Vector& unitsX) { for(int i = 0; scatter.GetXMinUnit() + i*scatter.GetMajorUnitsX() <= scatter.GetXRange(); i++) { for (int ii = 0; ii < 9; ++ii) unitsX << scatter.GetXMinUnit() + i*scatter.GetMajorUnitsX() + (log10((ii+1)*10)-1)*scatter.GetMajorUnitsX(); } } ScatterDemo *Construct6() { static Tab6_Logarithmic tab; return &tab; } INITBLOCK { RegisterExample("Log", Construct6, __FILE__); }