Definition at line 309 of file BarPlot.h. Referenced by Impala::Application::TagsLife::BarPlot::AddColumnsFromDataSource(), AddColumnsFromDataSource(), Impala::Application::TagsLife::BarPlot::findStep(), and findStep(). 00309 { 00310 double range = max - min; 00311 if(range < 0) range *= -1; 00312 double exponent = floor(log10(range)); 00313 double coefficient = range/pow(10, exponent); 00314 00315 double step = 1; 00316 if(coefficient <= 5) { 00317 step = 0.5; 00318 if(coefficient <= 2.5) { 00319 step = 0.25; 00320 if(coefficient == 1) step = 0.1; 00321 } 00322 } 00323 00324 step *= pow(10, exponent); 00325 if(step == 2.5) step = 2; 00326 00327 newMin = floor(min/step)*step; 00328 newMax = ceil(max/step)*step; 00329 00330 if(min > max) return -step; 00331 return step; 00332 }
|