Results 1 to 4 of 4

Thread: Axis Auto Scale

  1. #1
    Join Date
    Jun 2011
    Location
    Chennai, India
    Posts
    30
    Thanks
    13
    Thanked 6 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question Axis Auto Scale

    I'm creating a custon Plot by subclassing QwtPlotItem and QwtPlot. When i set the axis autoscale (yAxis), the values for the scale takes double of the maximum for my y value. Which function do I need to override to set the correct y axis values?

    Also, which method is called to print the title on the legend? Is is drawLegendIdentifier() or is there some other method?

  2. #2
    Join Date
    Jun 2011
    Location
    Chennai, India
    Posts
    30
    Thanks
    13
    Thanked 6 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Axis Auto Scale

    Got it. I was returning the wrong values from the boundingRect() method of the PlotItem.

    But the other part (legend titles) is not solved.

  3. #3
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Axis Auto Scale

    Quote Originally Posted by gkarthick5 View Post
    But the other part (legend titles) is not solved.
    An item on the legend is a QwtLegendItem, what is derived from QwtTextLabel.

    Uwe

  4. #4
    Join Date
    Jun 2011
    Location
    Chennai, India
    Posts
    30
    Thanks
    13
    Thanked 6 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Axis Auto Scale

    If i do the following:
    Qt Code:
    1. QwtLegend* legend = new QwtLegend();
    2. plot->insertLegend(legend);
    To copy to clipboard, switch view to plain text mode 
    will the legend automatically display all the items of the plot?

    Currently, I'm reimplementing
    Qt Code:
    1. drawLegendIdentifier(QPainter*, const QRectF&)
    To copy to clipboard, switch view to plain text mode 
    in my custom PlotItem, in which i'm filling the rectangle i get with the item's color. Is there any other function with which i can paint the text(title of the item) next to this rectangle?

Similar Threads

  1. improve the auto scaling of axis
    By 21did21 in forum Qwt
    Replies: 7
    Last Post: 7th July 2011, 20:26
  2. Y axis not auto scaling
    By pkj in forum Qwt
    Replies: 0
    Last Post: 12th May 2011, 17:05
  3. Replies: 4
    Last Post: 16th January 2011, 11:32
  4. qwp plot axis scale
    By Cal in forum Qwt
    Replies: 1
    Last Post: 11th May 2009, 18:10
  5. 4 axis auto scale..
    By Vincenzo in forum Qwt
    Replies: 0
    Last Post: 22nd March 2009, 02:12

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.