[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: Using KChart
From: Inge Wallin <inge () lysator ! liu ! se>
Date: 2007-01-18 22:25:28
Message-ID: 200701182325.28434.inge () lysator ! liu ! se
[Download RAW message or body]
On Thursday 18 January 2007 17.01, Cyrille Berger wrote:
> if there is a simple way (one line) in kdchart to : plot three QVector<int>
> (like one line for the function call) I have nothing against moving kdchart
> to kofficelib (or find a more efficient way to share it, like considering
> it as an external dependency).
Here you go! :-)
This is the file examples/Widget/Simple/main.cpp from the examples
subdirectory. It's not strange you didn't see it, because I didn't import
all the example files.
#include <QApplication>
#include <KDChartWidget>
int main( int argc, char** argv )
{
QApplication app( argc, argv );
KDChart::Widget widget;
widget.resize( 600, 600 );
QVector< double > vec0, vec1, vec2;
vec0 << -5 << -4 << -3 << -2 << -1 << 0
<< 1 << 2 << 3 << 4 << 5;
vec1 << 25 << 16 << 9 << 4 << 1 << 0
<< 1 << 4 << 9 << 16 << 25;
vec2 << -125 << -64 << -27 << -8 << -1 << 0
<< 1 << 8 << 27 << 64 << 125;
widget.setDataset( 0, vec0, "Linear" );
widget.setDataset( 1, vec1, "Quadratic" );
widget.setDataset( 2, vec2, "Cubic" );
widget.show();
return app.exec();
}
> The reason why I proposed kdeeduplot is mostly because it's _very_ simple,
> the tutorial for it would be 5 lines. And browsing through the kdchart
> documentation, all exemples I see are very complicated (not to say scary).
That's good. However, importing 1000 lines of code, duplicating something
that's already here, just to save 5 lines does seem a bit counter productive
to me. :-)
-Inge
--
Inge Wallin | Thus spake the master programmer: |
| "After three days without programming, |
inge@lysator.liu.se | life becomes meaningless." |
| Geoffrey James: The Tao of Programming. |
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic