I need to set width of QLineSeries
I do
QPen pen = series->pen();
pen.setWidth(1);
series->setPen(pen);
And it works but color is changed to black. What do I need to do to set only the width?
I need to set width of QLineSeries
I do
QPen pen = series->pen();
pen.setWidth(1);
series->setPen(pen);
And it works but color is changed to black. What do I need to do to set only the width?
You need to specify brush with needed color. F.e.
Update:
It can be done if you will set pen after
addSeries()
call. BecausedefaultColor
(color of your pen) in your case is just (1,0,0,0), default color (this kind of blue color on the plot) depends on chosen theme and appears after you callchart->addSeries(series);
So only way to achieve what you want is smth like next: