QCustomPlot Discussion and Comments

Uncertainty regarding Legend Placement ChangeReturn to overview

Hi there,

I just implemented functionality to move the legend of a plot to different locations. I chose the placement given in ored Qt::Alignment values like this:

axisRect()->insetLayout()->setInsetAlignment(0, Qt::AlignTop|Qt::AlignLeft);

To my big surprise when I add a graph to the plot the legend changes its place back to a position in the lower right of the plot. To avoid that behavior I need to repeat the placement change whenever I have added a graph to the plot. This behavior seems to be a bit strange to me. Is this really intentional or can I somehow avoid the placement change upon addition of graphs to a plot?

Is it possible that your own code to add graphs changes the legend placement?

YES! Just analyzed the procedure in the debugger and found a bug there that leads to the problem. Thanks a lot for your hint!