[Interest] Qt Charts: Making the legend top and right aligned

Christopher Probst christop.probst at gmail.com
Wed Apr 11 16:05:56 CEST 2018


I have noticed that! Clearly they thought of it! I tried grabbing the y
coordinate of the legend and changing it. That also does not work! It would
be nice to have a solution to this.

On 11 April 2018 at 10:03, Mike Chinander <chinander at gmail.com> wrote:

> Not sure of a solution to this, but noticed that unlike other uses of
> Qt::Alignment flags, the QLegend docs say, "If you set more than one flag,
> the result is undefined."
>
> https://doc.qt.io/qt-5.10/qlegend.html#alignment-prop
>
> On Wed, Apr 11, 2018 at 8:51 AM, Christopher Probst <
> christop.probst at gmail.com> wrote:
>
>> Hi,
>>
>> I would like to place the legend of  chart that uses Qt charts at the top
>> right of the view. I would have expected something like this to work:
>>
>>  m_chart->legend()->setAlignment(Qt::AlignTop| Qt::AlignRight)
>>
>>
>> Unfortunately it does not! Is there a direct way to  make the legends (right or left) be top aligned rather then middle.?
>>
>>
>> Thanks,
>>
>> Christopher
>>
>>
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180411/ad975471/attachment.html>


More information about the Interest mailing list