Originally posted by wkk1000
Thanks expert. I think i dont have the license policy for Qwt. Pls advise how to use the QPainter and Qcanvas for drawing the bar graph with axises and legends.
Thanks.
Are you using Qt 3? The answer is a bit different with Qt 4.
I think if you're GPL you're ok, but if commercial, you'd need to think about licensing for that. On the other hand, simple bar charts are not hard, they're basically just rectangles and lines, with some labels. If you've never done graphical programming you have some learning to do, but don't fear it, as it isn't hard.
The Qt assistant help page shows something really simple:
|
Source code
|
1
2
3
4
5
6
|
void SimpleExampleWidget::paintEvent()
{
QPainter paint( this );
paint.setPen( Qt::blue );
paint.drawText( rect(), AlignCenter, "The Text" );
}
|
You'll simply derive from QWidget, and override the paintEvent.