February 24, 2012

shoyeb shoyeb
Lab Rat
99 posts

How to plot a graph in Qt without using QWT

 

Hi,

i want to draw an X-Y plot using Qt libraries..
can anyone tell me how can i acheive this…

i know that it can be done using QWT, but want to do it in Qt..
please help me..

thanx in advance…

 Signature 

There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

11 replies

February 24, 2012

Lukas Geyer Lukas Geyer
Gene Splicer
2074 posts

Create your own widget by subclassing QWidget and reimplementing painEvent().

I strongly recommend that you take a look at the examples [developer.qt.nokia.com] or a book [qtrac.eu] first.

February 24, 2012

shoyeb shoyeb
Lab Rat
99 posts

thanks lukas…

now when i draw my XY plot, then its gonna have x-axis and y-axis…

now when it want to plot apoint in the graph, then the point is not coming exactly on the graph, its due the fact that they are being drawn on the scale coordinates so what can i do to make it work properly..

 Signature 

There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

February 24, 2012

Lukas Geyer Lukas Geyer
Gene Splicer
2074 posts

Did you transform the painter in any way? Are you using widget local coordinates? Have you considered any border you have drawn?

C++ GUI Programming with Qt 4 (First Edition), which is available for free at the link found in my previous post, has a chapter about custom widgets using the example of a plot widget, which supports zooming and scaling.

February 24, 2012

shoyeb shoyeb
Lab Rat
99 posts

@lukas thank u..

i will try that and get back to u..

 Signature 

There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

February 24, 2012

David_Gil David_Gil
Lab Rat
29 posts

Hi!

I also want to plot graphs, but I don’t want to make a new program because there are already good ones and I don’t have the level to make something better.

The approach I will probably take is using SciDAVis [scidavis.sourceforge.net], which is written in Qt and has a plugin interface.

I let you know this in case it’s useful, but I suppose you want to write your own.

Regards

February 24, 2012

shoyeb shoyeb
Lab Rat
99 posts

@ david_gil thanx..

 Signature 

There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

February 24, 2012

shoyeb shoyeb
Lab Rat
99 posts

@david_gil

i downloaded the link u gave and i was reading the installation instructions, and it is saying that before installing it i must hve python installed on my machine…

and i am not havin python installed, also i dont want to install it…

i wanna do it without using python…
how can i do this…

 Signature 

There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

February 24, 2012

David_Gil David_Gil
Lab Rat
29 posts

Hi,

Sorry, I thought it was a good idea, but I’ve seen that SciDAVis plugin capabilities can be found only in the bleeding edge version (0.3.0). Here you can see that version’s classes [scidavis.sourceforge.net].

Regards

May 29, 2012

David_Gil David_Gil
Lab Rat
29 posts

Hi!

Perhaps you still find it interesting: http://www.workslikeclockwork.com/index.php/components/qt-plotting-widget/

It isn’t QWT and seems very customizable.

Take care

May 30, 2012

Wilk Wilk
Ant Farmer
120 posts

Hello.
Do you have any reasons for not to use Qwt?

June 7, 2012

Andre Andre
Area 51 Engineer
6031 posts

Mosaic also has some plotting components [mosaicsoftware.net] you might be interested in.

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

 
  ‹‹ Get Video FPS using Qt Phonon      [Solved] Qt text rendering issue on windows xp korean version ››

You must log in to post a reply. Not a member yet? Register here!