I'm implementing a custom bar chart by extending QwtPlot and overriding the drawItems() method. I set the number of bars i have to draw on the canvas in a particular method(in which i create the plotItems). I dont want the bar width to be too small or too big. How do i restrict the canvas size for this? (i compute the bar width in draw items as canvas()->width() / Number_of_items).