@@ -913,25 +913,23 @@ namespace ecolab
913
913
}
914
914
};
915
915
916
+ // compute minimum gap between successive points to determine bar width
917
+ double w=iflogx (maxx)-iflogx (minx);
918
+ for (size_t j=1 ; j<x[i].size (); ++j)
919
+ w=std::min (w, iflogx (x[i][j])-iflogx (x[i][j-1 ]));
920
+ w*=ls.barWidth ;
921
+
916
922
size_t j=0 ;
917
923
if (inBounds (iflogx (x[i][j]), y[i][j], side))
918
924
{
919
- auto w = ls.barWidth *(x[i].size ()>1 ? abs (iflogx (x[i][1 ]) - iflogx (x[i][0 ])): iflogx (maxx)-iflogx (minx));
920
925
auto xx=x[i].size ()>1 ? iflogx (x[i][0 ])-0.5 *w: iflogx (minx);
921
926
shadowShowBox (xx,xfy (y[i][0 ]),w);
922
927
}
923
928
for (++j; j<x[i].size ()-1 ; ++j)
924
929
if (inBounds (iflogx (x[i][j]), y[i][j], side))
925
- {
926
- auto w=ls.barWidth *min (abs (iflogx (x[i][j]) - iflogx (x[i][j-1 ])),
927
- abs (iflogx (x[i][j+1 ])-iflogx (x[i][j])));
928
- shadowShowBox (iflogx (x[i][j])-0.5 *w, xfy (y[i][j]), w);
929
- }
930
- if (x[i].size ()>1 && inBounds (iflogx (x[i][j]), y[i][j], side))
931
- {
932
- auto w=ls.barWidth *abs (iflogx (x[i][j]) - iflogx (x[i][j-1 ]));
933
930
shadowShowBox (iflogx (x[i][j])-0.5 *w, xfy (y[i][j]), w);
934
- }
931
+ if (x[i].size ()>1 && inBounds (iflogx (x[i][j]), y[i][j], side))
932
+ shadowShowBox (iflogx (x[i][j])-0.5 *w, xfy (y[i][j]), w);
935
933
}
936
934
default : break ;
937
935
}
0 commit comments