diff --git a/DistributionChart2D.cpp b/DistributionChart2D.cpp index 2d6f263..dff33de 100644 --- a/DistributionChart2D.cpp +++ b/DistributionChart2D.cpp @@ -308,7 +308,7 @@ public: for(uint i=0;i0) - chart->DrawCircle(x,y,*cp32); + chart->DrawCircle(x,y,(*cp32)); ++cp32; } @@ -459,24 +459,28 @@ Chart *ToChart32(const PositionStat *ps) { uint col=10; uint row=10; + uint stop_str_width=0; AnsiString str; AnsiString num_str; const AnsiString str_total=AnsiString::numberOf(ps->count); - AnsiString step_str[6]= + AnsiString step_str[STOP_COUNT]= { AnsiString::numberOf(max_count), AnsiString::numberOf(uint(max_count*0.8f)), AnsiString::numberOf(uint(max_count*0.6f)), AnsiString::numberOf(uint(max_count*0.4f)), AnsiString::numberOf(uint(max_count*0.2f)), - AnsiString::numberOf(0), }; char space[32]; memset(space,' ',32); + + for(uint i=0;iDrawGradient(col+(stop_str_width+1)*CHAR_BITMAP_WIDTH*CHAR_BITMAP_SCALE, + row,CHAR_BITMAP_WIDTH*CHAR_BITMAP_SCALE,CHAR_LINE_HEIGHT*STOP_COUNT); + + chart->DrawGradient(col+(str_total.Length()+stop_str_width+4)*CHAR_BITMAP_WIDTH*CHAR_BITMAP_SCALE, + row,CHAR_BITMAP_WIDTH*CHAR_BITMAP_SCALE,CHAR_LINE_HEIGHT*STOP_COUNT); + for(uint i=0;i0) { - num_str=AnsiString::numberOf(step_count[i]); - - str.Strcat(space,str_total.Length()-num_str.Length()); - - str+=num_str; - - if(step_count[i]>0) - { - str+=" - "; - str+=AnsiString::numberOf(float(step_count[i])*100.0f/float(ps->count)); - str+="%"; - } + str+=" "; + str+=AnsiString::numberOf(float(step_count[i])*100.0f/float(ps->count)); + str+="%"; } chart->DrawString(str,col,row,stop_color[i],255);