##// END OF EJS Templates
Fixed bug in setting chart theme...
Fixed bug in setting chart theme The bug was that if you first add a series, then change theme and then restore the original theme, the color of the series was changed even though it should have been restored to match the original color.

File last commit:

r273:108ca5a00d74
r312:0677c9dd6d92
Show More
barlabel.cpp
36 lines | 642 B | text/x-c | CppLexer
sauimone
added labels to barcharts
r114 #include "barlabel_p.h"
#include <QPainter>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
BarLabel::BarLabel(QGraphicsItem* parent) : ChartItem(parent)
{
}
void BarLabel::set(QString label)
{
mLabel = label;
}
void BarLabel::setPos(qreal x, qreal y)
{
mXpos = x;
mYpos = y;
}
Michal Klocek
minor. compilation fix
r116 void BarLabel::setSize(const QSizeF &size)
sauimone
added labels to barcharts
r114 {
mSize = size;
}
void BarLabel::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
painter->drawText(boundingRect(),mLabel);
}
QRectF BarLabel::boundingRect() const
{
sauimone
floating values working now. bounding rect bug fixed
r273 QRectF r(mXpos, mYpos, mSize.width(), mSize.height());
sauimone
added labels to barcharts
r114 return r;
}
QTCOMMERCIALCHART_END_NAMESPACE