Results 1 to 2 of 2

Thread: Bar Chart centered on Labels

  1. #1
    Join Date
    Sep 2009
    Posts
    57
    Thanks
    7
    Thanked 5 Times in 4 Posts

    Default Bar Chart centered on Labels

    Hi,

    I am trying to plot a simple bar chart, using the steps curve style the bars are not centered on the x-axis dimension.

    I'm really scratching my head here, and wonder if there is a simple answer?

    Screenshot-Mark Liversedge.jpg

    Attached screenshot shows a data series with 6 values on the x-axis, but you will see that the top of the bar starts from the x-value (year in this case) rather than being centred over it.

    I am also showing other data series on this plot as dots and lines so don't want to move the axis labels (and indeed that seems tricky in itself).

    Thanks for any help you can provide,
    Mark

  2. #2
    Join Date
    Sep 2009
    Posts
    57
    Thanks
    7
    Thanked 5 Times in 4 Posts

    Default Re: Bar Chart centered on Labels

    Sorry, I know it is bad to reply to your own thread.

    I looked around at the histogram example on the list and svn and then just decided to subtract 0.5 from the x axis values when plotting curves with style steps. I am fortunate that I am working with integer values for x only (days, weeks, months, years).

    Forgive my haste in posting here.

    Thanks,
    Mark

Similar Threads

  1. Why QFileDialog::getOpenFileName is not centered?
    By ricardo in forum Qt Programming
    Replies: 20
    Last Post: 30th August 2009, 23:08
  2. centered text label
    By djconnel in forum Qwt
    Replies: 5
    Last Post: 28th April 2009, 17:22
  3. what chart for qt?
    By yunpeng880 in forum Qt Programming
    Replies: 1
    Last Post: 8th January 2009, 11:07
  4. [Qt4]: Adding centered items in QListWidget
    By Jojo in forum Qt Programming
    Replies: 4
    Last Post: 16th March 2006, 20:04

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.