QCustomPlot Discussion and Comments

Degrees symbol in axis-label?Return to overview

Hey guys,

I want to set a axis-label to the unit it is for.
When the axis shows values from type Angle, i would like to set the axis-labels text like this: "Angle [°]".

I tried following lines:

plot->xAxis->setLabel("Angle [°]");
plot->xAxis->setLabel("Angle [\xB0]");

But both didnt work. Instead of the symbol, I get a question mark..

Somebody can help me here?

When someone has the same problem, I fount a solution:

plot->yAxis->setLabel(QLatin1String("Angle [°]"));

Actually it didnt work for me.
I used
plot->yAxis->setLabel(QStringLiteral("Angle [°]"));
and it worked!

PS:The degree symbol can be write also with trUtf8("°")