Skip to content

Commit

Permalink
Fix annotations with standard colors
Browse files Browse the repository at this point in the history
.. colors were not translated to standard colors when
   setting the style sheet for a label.

Fixes #4112
  • Loading branch information
liversedge committed Dec 19, 2021
1 parent b8beaf3 commit 7e10b05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Charts/GenericPlot.cpp
Expand Up @@ -1369,7 +1369,7 @@ GenericPlot::plotAnnotations(GenericSeriesInfo &seriesinfo)
QString string = annotation.labels.join(" ");
add->setFont(std);
add->setText(string);
add->setStyleSheet(QString("color: %1").arg(seriesinfo.color));
add->setStyleSheet(QString("color: %1").arg(RGBColor(QColor(seriesinfo.color)).name()));
add->setFixedWidth(fm.boundingRect(string).width() + (25*dpiXFactor));
add->setAlignment(Qt::AlignCenter);
legend->addLabel(add);
Expand Down Expand Up @@ -1444,7 +1444,7 @@ GenericPlot::plotAnnotations(GenericSeriesInfo &seriesinfo)
QLabel *add = new QLabel(this);
add->setFont(std);
add->setText(lr->text());
add->setStyleSheet(QString("color: %1").arg(annotation.color));
add->setStyleSheet(QString("color: %1").arg(RGBColor(QColor(seriesinfo.color)).name()));
add->setFixedWidth(fm.boundingRect(lr->text()).width() + (25*dpiXFactor));
add->setAlignment(Qt::AlignCenter);
legend->addLabel(add);
Expand Down

0 comments on commit 7e10b05

Please sign in to comment.