How to stack QT Charts legend items vertical on bottom
-
I need the legend items stacked one above another (vertically).
When I do:QtCharts::QChart *m_pieChart; //member variable m_pieChart->legend()->setAlignment(Qt::AlignRight);
I get this:
And setting the alignment to bottom moves the legend to the bottom:m_pieChart->legend()->setAlignment(Qt::AlignBottom);
BUT the legend items are not stacked vertically anymore!
How to move the legend to the bottom AND have them stacked vertically? -
@Saee1101
I see you have copied and pasted your question directly from stackoverflow, https://stackoverflow.com/questions/39243206/how-to-stack-qt-charts-legend-items-vertical-on-bottom, without mentioning this which is not helpful. That was asked 7 years ago. And did not attract any solutions. Suggestions included:Looking in the sources, starting here, it doesn't seem possible without modifying Qt's code
[That is what I would have said.] And:
I solved it differently using QPieSlice::setLabelVisible(true) on all slices.
And:
Why don't you use the detachFromChart()? Look at this
Just saying "I have to do this" and "please help me" does not help. There is a reason why nobody posted a definite solution. So which of these did you try?