Results 1 to 6 of 6

Thread: QqtPlot setAxisLabelRotation doesnt work on zoom (QwtPlotMagnifier)

  1. #1
    Join Date
    Jun 2015
    Posts
    109
    Thanks
    20
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QqtPlot setAxisLabelRotation doesnt work on zoom (QwtPlotMagnifier)

    Hi,

    I have been working on plot where I want to roll the graph and Axis when display signal reached to the boundary of plot/widget.
    So for this purpose I have used m_plot->setAxisLabelRotation(QwtPlot::xBottom, -50.0); and it works.

    But when I zoom in/out (QwtPlotMagnifier), the rotation of graph and Axis is get disable automatically, How should I make it continue even after zooming effect.

    Thanks

  2. #2
    Join Date
    Jun 2015
    Posts
    109
    Thanks
    20
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QqtPlot setAxisLabelRotation doesnt work on zoom (QwtPlotMagnifier)

    Please anyone has any solution or suggestions over it ?

  3. #3
    Join Date
    Jun 2015
    Posts
    109
    Thanks
    20
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QqtPlot setAxisLabelRotation doesnt work on zoom (QwtPlotMagnifier)

    Please somebody give some suggestions on this


    Added after 34 minutes:


    I just working on code, I have some experiences below,
    - At start, the graph is automatically rotate the graph, as signal comes. But on wheel zoom, the auto scaling gets OFF. And graph not update its scale nor rotate.
    - Then I have added m_plot->setAxisAutoScale(QwtPlot::xBottom, true); in QEvent::Wheel, which makes it auto scale every time but on zooming it zoomed only on Y-Axis not on X-Axis

    Here I understand that I have set auto scaling on X-Axis so yes it will zoom only on Y-Axis.
    So the question is how I can keep both in the code, i.e., I can able to zoom on both axis and also able to auto scale the graph ?
    Last edited by npatil15; 24th January 2019 at 11:05.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QqtPlot setAxisLabelRotation doesnt work on zoom (QwtPlotMagnifier)

    So the question is how I can keep both in the code, i.e., I can able to zoom on both axis and also able to auto scale the graph ?
    This makes no sense. Think about it: Autoscaling means if you zoom the x axis, the y axis is scaled to the minimum and maximum y values within the x range. Or, if you zoom on y, then the x axis range is changed so that it is limited only to the range that holds the y values.

    How could you possibly zoom both axes at the same time while also autoscaling both of them at the same time?
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    Jun 2015
    Posts
    109
    Thanks
    20
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QqtPlot setAxisLabelRotation doesnt work on zoom (QwtPlotMagnifier)

    You Right,
    So I'm trying code hack, that what I want to do,

    on wheel/scroll zoom or on plotzoom the auto scaling should false, and I guess I can do that,
    So what I/m thinking to set a button/Marker on the legend, on pressing button auto scaling makes true/false, or emit a signal.

    But I'm facing a challenge here, whenever I set button(QPushButton) on legend, it's get override by my 4 Markers and not able to adjust on the legend, as shown in the image below,
    Second solutiion, I have tried to set 5th QwtPlotMarker and want to set clickable, but my other 4 markers have setDefaultItemMode checkable, So how I can set different setDefaultItemMode for 5th Marker ?
    graph.jpg

  6. #6
    Join Date
    Jun 2015
    Posts
    109
    Thanks
    20
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QqtPlot setAxisLabelRotation doesnt work on zoom (QwtPlotMagnifier)

    I have done it using small hack,

    Use QGroupBox and add QCheckBox in QGroupBox. Then set QGroupBox setParent to QwtLegend.

    Now QGroupBox is set at the top and set QwtLegend x-axis geometry to 70, i.e., end of the QGroupBox.
    So here no one overlaps each other. And using checkbox I have triggered signal which set and reset my particular feature on the plot.

    And thanks to the QGroupBox, in future I can easily add QPushButton also.


Similar Threads

  1. Replies: 2
    Last Post: 21st May 2013, 11:43
  2. Replies: 3
    Last Post: 18th May 2011, 17:56
  3. QwtPlotMagnifier initial zoom
    By jomarin in forum Qwt
    Replies: 6
    Last Post: 6th May 2010, 09:29
  4. QwtPlotMagnifier Invert Wheel Zoom
    By jmsbc in forum Qwt
    Replies: 2
    Last Post: 13th March 2009, 00:12
  5. How come this doesnt work?
    By ShaChris23 in forum Newbie
    Replies: 8
    Last Post: 16th June 2007, 05:43

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.