Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: Qt Charts API: create static and animating charts for your application

  1. #1
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Lightbulb 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.

  2. #2
    Join Date
    Dec 2010
    Location
    BEIJING CHINA
    Posts
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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.
    Last edited by xiaokui; 11th January 2011 at 03:15.

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default 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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  4. #4
    Join Date
    Jan 2011
    Location
    Russian Federation
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  5. #5
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default 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

  6. #6
    Join Date
    Jan 2011
    Location
    Russian Federation
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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.

  7. #7
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    2
    Thanked 6 Times in 6 Posts

    Default Re: Qt Charts API: create static and animating charts for your application

    is this project dead before born??

  8. #8
    Join Date
    Jan 2011
    Location
    Russian Federation
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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.

  9. #9
    Join Date
    Jan 2011
    Location
    Russian Federation
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Charts API: create static and animating charts for your application

    Hey, any body live?

  10. #10
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Qt Charts API: create static and animating charts for your application

    Quote Originally Posted by Nightmaster View Post
    Hey, any body live?
    No we are dead
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  11. The following user says thank you to ComaWhite for this useful post:

    dridk (7th February 2011)

  12. #11
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Exclamation 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 ?

  13. #12
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default 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

  14. #13
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default 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!



    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!




    Added after 9 minutes:


    How does it work :
    Qt Code:
    1. QListChartModel * model = new QListChartModel;
    2. model->setTitle("title");
    3. model->addData("30", "20", "50");
    4. model->setLabel("red", "green","blue");
    5.  
    6. QPieGraphicsChartItem * item = new QPieGraphicsChartItem;
    7. item->setModel(model);
    8. item->setBackgroundColor(Qt::white);
    9. item->setColor("red", Qt::Red);
    10.  
    11. QGraphicsScene * scene = new QGraphicsScene(view);
    12.  
    13. scene->addItem(item);
    14. view->show();
    To copy to clipboard, switch view to plain text mode 
    Last edited by dridk; 8th February 2011 at 17:06.

  15. #14
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default 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
    Last edited by marcvanriet; 9th February 2011 at 00:00.

  16. #15
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default 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

  17. #16
    Join Date
    Jan 2011
    Location
    Russian Federation
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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
    Last edited by Nightmaster; 13th February 2011 at 08:43.

  18. #17
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default 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

  19. #18
    Join Date
    Jan 2011
    Location
    Russian Federation
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  20. #19
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default 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

  21. #20
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default 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

Similar Threads

  1. Charts in Qt!!
    By rachana in forum Qt Programming
    Replies: 3
    Last Post: 6th May 2011, 07:10
  2. Help with Bar charts
    By romeo in forum Qwt
    Replies: 0
    Last Post: 30th June 2010, 17:58
  3. could qt use ILOG JViews Charts?
    By yunpeng880 in forum Qt Programming
    Replies: 0
    Last Post: 6th May 2009, 10:16
  4. drawing math charts
    By bisz in forum Newbie
    Replies: 3
    Last Post: 18th October 2007, 11:17
  5. MVC charts for Qt4
    By wysota in forum Qt-based Software
    Replies: 8
    Last Post: 28th September 2006, 17:06

Tags for this Thread

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.