Qt Charts API: create static and animating charts for your application
Hello,
I plan to create a qt charts api in the same way than google charts tools. With more option.
Why ?
Because I didn't find any nice library which do this job. Qwt is ugly and it's made for scientifist. If you know any other opensource library which do the same job, please tell me.
So, if you are interesting to help me in this project, please answer me . Then we will choice a repository ( gitorious, google code...) and define the API. ( QGraphicsItem or QML....)
I think this library is really important. Official Qt has no plan about that in the future release. And I guess it's not hard to build. But I cannot do it alone, and I need you.
Re: Qt Charts API: create static and animating charts for your application
good idea. I am interested in this project.
Eastwood Eastwood Charts is an independent and open source implementation of the Google Chart API.
Re: Qt Charts API: create static and animating charts for your application
A week ago or so, there was a similar thread.
Someone posted a link to qt-apps web site to a chart lib.
You might want to have a look there first.
Re: Qt Charts API: create static and animating charts for your application
Hi Everyone!
Very nice idea, but my class changed and became not universal.
histogram now looks : http://img30.imageshack.us/img30/8013/exmpl.jpg
Can also use my source code, but everything is based on the QPainter. I have some time now :)
Re: Qt Charts API: create static and animating charts for your application
Hi,
At first glance, it seems that the 'API' is just a text string filled with different kinds of information. Seems not right to use this as a method to interface with an object in C++.
Also, I would just create chart objects that paint on a painter object. Then you can paint the chart on anything. You can make a convenience class derived from QGraphicsItem to make it easier to put a chart on a QGraphicsView. And you can also make a widget derived class to put it on a dialog.
Regards,
Marc
Re: Qt Charts API: create static and animating charts for your application
Right, need to think about how to use the concept of Google Charts in QT.
how it would look like?
The same Parameter? same Graphics? hm.
Re: Qt Charts API: create static and animating charts for your application
is this project dead before born??
Re: Qt Charts API: create static and animating charts for your application
I do not know, just I had something on qt-apps : http://qt-apps.org/content/show.php/...content=132560
I don't understand how the result will look. Because java and web version can be represented in this form : https://chart.googleapis.com/chart?c...hl=Hello|World
Qt version not.
Re: Qt Charts API: create static and animating charts for your application
Re: Qt Charts API: create static and animating charts for your application
Quote:
Originally Posted by
Nightmaster
Hey, any body live?
No we are dead
Re: Qt Charts API: create static and animating charts for your application
No we are not !
Sorry, I havn't enable email notification.. So I didn't see any update! But Now I am here!
First :
I have created a repository on gitorious : http://gitorious.org/qtcharts. Please Join the qtcharts team !!
second :
API architecture :
I propose to create 3 sub project :
- 1 : QPainter Layer : draw all sharts from a QPainter
- 2 : QGraphicsItem : Create each sharts item using QPainter layer
- 3 : QChartData : Provide data to be load
class tree example :
QChartPainter
-QLineChartPainter
-QPieChartPainter
QGraphicsChartItem
-QGraphicsLineChartItem
-QGraphicsPieChartItem
Discussion
We have to speak together about qtcharts! So, please join #qtcharts on freenode!
If there is nobody, please wait !
So, now, I m waiting for your suggestion about the API architecture ? What about animation ? Interaction ? QML ?
Re: Qt Charts API: create static and animating charts for your application
Can't find any qtcharts on freenode. Anyway :
Data :
- what data can you handle : integer / double values, labels, min/max indicators, complex values, quaternions, ...
- do you use a model-view approach or not ?
- will you have only 1 data series, or more (multiple lines in your graph)
Display :
- are you going to make different display classes for the qpainter and qgraphicsview ? Will be difficult to make sure they look the same. QGraphicsview is not required for just showing graphs, but is sure is handy for interactive graphs (selecting data points, pie slices, ...)
- are you going to stick to line charts and pie charts ? or also bar graphs, coloured maps, ...
Classes :
- I would make a 'QtCharts' object that can hold any kind of data, for 1 or more data 'lines', and also additional data like labels, min/max values, .... This object could then be painted by the painter classes, be it either pie or line.
Regards,
Marc
Re: Qt Charts API: create static and animating charts for your application
Yes, you are right! We have to provide a Model/view architecture!
And I didn't understand about your QtCharts object ?
About Data, a first approch is to split Uni-dimensional Data and Bi-Dimensionsal. And use QVariant as variable.
Exemple : Bidimensional
QChartData data;
data.add("jan", 23);
data.add("Feb", 32.3);
data.add("Mar", 14);
data.xAxis().setLabel("Month");
data.yAxis().setLabel("temperature);
Or : Unidimensional
QChartData data;
data.add("2");
data.add("4");
data.add("5");
data.add("6");
The question is : Do we have to provide the same Object for uni et bi dimensionnal ?
And what about Multi dimensional data ?
About display :
I agree with marc! Create a QPainter Layout and on the top, create Many QGraphicsItem.
So , The chat room is open on : irc.freenode.org #qtcharts
I m currently looking other API language.
You are all welcome to help us in this project!
Added after 4 minutes:
I just found this documentation ! It sounds great! Can be an example for qtcharts!
http://approximatrix.com/products/op...mages/arch.png
look the documentation here :
http://approximatrix.com/products/op...eloper-s-guide
Added after 29 minutes:
Here is a quickly preview ! It may be change ofcourse!
http://download.tuxfamily.org/omed/q...s/qtcharts.png
Added after 9 minutes:
How does it work :
Code:
QListChartModel * model = new QListChartModel;
model->setTitle("title");
model->addData("30", "20", "50");
model->setLabel("red", "green","blue");
QPieGraphicsChartItem * item = new QPieGraphicsChartItem;
item->setModel(model);
item->setBackgroundColor(Qt::white);
item->setColor("red", Qt::Red);
scene->addItem(item);
view->show();
Re: Qt Charts API: create static and animating charts for your application
Hi,
I'm not so familiar with the model/view architecture, but it seems a better approach to me to use the standard model classes, and not define your own. A programmer creates a QSqlQueryModel (which is a table model), and the ChartItem classes use this model (using myChart->setModel( mySqlQueryResults ). A convenience class can be made using QStandardItemModel in case you are not taking data from a database or so.
For a pie chart, you can say something like myChart->setPieFields( "country", "population" ) to say that the column 'country' must be used as labels for the pies, and 'population' for the values to display. You could define additional colums for other properties (e.g. color ).
For a line chart, you can then say something like :
- myChart->setXValues( "time") : define that the X values are in the 'time' column. If not defined, row number is used
- myChart->addLine( "progress" ) : add a line that takes data from the 'progress' column
- forecastline = myChart->addLine( "forecast" ) : add a second line taking data from the 'forecast' column
- forcastline->setMinMax( "forecastMin", "forecasrMax" ) : add minimum and maximum indicators for the forecast line for the 'forecastMin' and 'forecastMax' columns
Additional parameters / methods could specify the label, color, ...
The "myChart" is an object that contains different members for different elements of a chart (it contains different 'abstractgraphicschartitems' in your scheme). These are the lines as shown above, but also a title, axis definitions, legend, lighting effect, ...
I'm not sure about the painting. The easiest way is to define a PieChart class ( so like myChart = new PieChart() ) and a LineChart class (like myChart = new LineChart() ) and let them take care of the painting themselve. The approach of approximatrix is to define a renderer for each 'line' or 'data series'. This way it would be easy to make a chart that contains data presented in bars and also data in lines, which seems like a nice feature.
I'm going to read a bit more about view classes now.
Best regards,
Marc
Added after 10 minutes:
Seems I'm reinventing the wheel yet again...
Take a look at ItemViews Chart Example
Regards,
Marc
Re: Qt Charts API: create static and animating charts for your application
Hi,
Found some more in google groups : see Ideas for Libqxt. There is some working code on https://bitbucket.org/aep/qt-charts/ that shows a line graph.
Best regareds,
Marc
Re: Qt Charts API: create static and animating charts for your application
Glad you're alive :-)
A agree with Marcvanriet! Model architecture will be good. I think need to start with a complete description of the architecture.
Can't put on gitorious my developments on the drawing :( Try again
I don't know freenode is a single server or server group, but i'm on chat.freenode.net #qtcharts
Re: Qt Charts API: create static and animating charts for your application
Hi,
I think chatting will be difficult because of the time zone differences (I'm in GMT-1).
Tried to load the project from gitorious, but got a 'server closed' message immediately.
One could also do some 'throw-away prototyping' first. E.g. take NightCharts and transform it step-by-step into a more generic graph framework.
Qwt also uses separate classes for the graph, curve, legend, ... by the way. I'm not sure if it can be used with the model-view architecture.
Regards,
Marc
Re: Qt Charts API: create static and animating charts for your application
My GMT +3.
IMHO, qwt was made with the unnecessary complexity. Qtcharts should be easy to use.
From Nightcharts can take part of rendering. I have achievements that are not included in nightcharts.
Sorry for my English, really do not have enough practice
Re: Qt Charts API: create static and animating charts for your application
We could also check out this : Birdeye visual analytics library
Has a lot of different kinds of charts and combinations thereof.
Regards,
Marc
Re: Qt Charts API: create static and animating charts for your application
Hello all,
I started yesterday to push my first commit on gitorious. I just create quickly the QChartDataModel:
So, if you want to test it :
git clone git://gitorious.org/qtcharts/qtcharts.git qtcharts
Be free to join us on gitorious : create an account and give me your nickname.
Another point, I create a mailing list to not overload the forum.
So, here is a public google group where you can join :
group site : http://groups.google.com/group/qtcharts-dev
mailing list : qtcharts-dev@googlegroups.com
Thanks for your interesting