Results 1 to 2 of 2

Thread: Draw a curve with multiple colors (dot by dot??)

  1. #1
    Join Date
    Sep 2009
    Location
    Surrey, BC, Canada
    Posts
    110
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Draw a curve with multiple colors (dot by dot??)

    Hi, all:

    I'm writing to ask how to use QWT to draw a curve with multiple colors???

    Say, I've got a 2D curve, say, y = f(x), both x and y are natural number.
    x is the time index, it starts from 1 and till 1000 ( milliseconds)
    and y is a number calculated with the time goes by. it varies from 1 to 20 .


    I want to realize something like:

    x from 1 to 100, draw red dots
    x from 101 to 500, draw yellow dots
    x from 501 to 990, draw red dots again
    x from 991 to 1000, draw blue dots.


    So, how can I realize that?


    Best Regards
    JIA
    Welcome to Vision Open
    http://www.visionopen.com

  2. #2
    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: Draw a curve with multiple colors (dot by dot??)

    Use 4 curves with different pens - or probably better: overload YourCurve::drawCurve().

    Uwe

Similar Threads

  1. Draw dynamic curve with various colors...
    By jiapei100 in forum Qwt
    Replies: 0
    Last Post: 25th October 2009, 04:31
  2. Replies: 5
    Last Post: 10th October 2008, 07:44
  3. Want to draw Curve
    By santhoshv84 in forum Qt Programming
    Replies: 1
    Last Post: 12th September 2008, 08:14
  4. Wants to draw Luminious Curve
    By santhoshv84 in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2008, 23:45
  5. Draw a rectangle alternating two colors with qPainter
    By SkripT in forum Qt Programming
    Replies: 12
    Last Post: 25th January 2006, 00:12

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.