mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-29 10:21:54 -06:00
#1173 Changed the legend text format in the pie chart
This commit is contained in:
parent
2e806e0cb7
commit
4d1c4031ef
4
ThirdParty/nightcharts/nightcharts.cpp
vendored
4
ThirdParty/nightcharts/nightcharts.cpp
vendored
@ -371,7 +371,7 @@ void Nightcharts::drawLegend(QPainter *painter)
|
||||
float x = lX+dist;
|
||||
float y = lY+dist+i*(painter->fontMetrics().height()+2*dist);
|
||||
painter->drawRect(x,y,painter->fontMetrics().height(),painter->fontMetrics().height());
|
||||
painter->drawText(x+painter->fontMetrics().height()+dist,y+painter->fontMetrics().height()/2+dist,pieces[i].pname + " - " + QString::number(pieces[i].pPerc)+"%");
|
||||
painter->drawText(x+painter->fontMetrics().height()+dist,y+painter->fontMetrics().height()/2+dist,pieces[i].pname + " (" + QString::number(pieces[i].pPerc, 'd', 0)+"%)");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -463,7 +463,7 @@ void pieceNC::setPerc(float Percentage)
|
||||
pPerc = Percentage;
|
||||
}
|
||||
|
||||
int Nightcharts::pieceCount()
|
||||
int Nightcharts::pieceCount() const
|
||||
{
|
||||
return pieces.count();
|
||||
}
|
||||
|
2
ThirdParty/nightcharts/nightcharts.h
vendored
2
ThirdParty/nightcharts/nightcharts.h
vendored
@ -62,7 +62,7 @@ public:
|
||||
int setFont(QFont f);
|
||||
int draw(QPainter *painter);
|
||||
void drawLegend(QPainter *painter);
|
||||
int pieceCount();
|
||||
int pieceCount() const;
|
||||
double palpha;
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user