After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 547408 - rewrite tests/pie-demo.c to contain more tests
rewrite tests/pie-demo.c to contain more tests
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: General
unspecified
Other opensolaris
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2008-08-12 10:37 UTC by Halton Huo
Modified: 2008-08-22 06:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for bug #547408 (15.20 KB, patch)
2008-08-12 10:47 UTC, Halton Huo
none Details | Review
patch for bug #547408 (10.30 KB, patch)
2008-08-13 09:37 UTC, Halton Huo
accepted-commit_now Details | Review
screeshot for GogPiePlot (61.76 KB, image/png)
2008-08-22 03:22 UTC, Halton Huo
  Details
screeshot for GogSurfacePlot (80.74 KB, image/png)
2008-08-22 03:23 UTC, Halton Huo
  Details

Description Halton Huo 2008-08-12 10:37:54 UTC
Current trunk (r2172) tests/pie-demo.c only contain test on GogPiePlot. This is very limited. It is better that we have a demo program can test all widget in plugins.

This is definitely enhancement.
Comment 1 Halton Huo 2008-08-12 10:47:23 UTC
Created attachment 116409 [details] [review]
patch for bug #547408

I renamed pie-demo to go-demo, which I think it is more accurate.

With this patch, go-demo can demo following charts:
- GogPiePlot
- GogRingPlot
- GogRadarPlot
- GogRadarAreaPlot
- GogPolarPlot
- GogBoxPlot
- GogHistogramPlot
- GogXYPlot
- GogBubblePlot
- GogXYColorPlot
- GogLinePlot
- GogAreaPlot
- GogBarColPlot
- GogDropBarPlot
- GogMinMaxPlot
- GogContourPlot
- GogSurfacePlot

The following two charts are not included for they look like not finished yet:
- XLContourPlot
- XLSurfacePlot

The following charts are not included for they have critical warning:
- GogLogFitCurve
- GogLinRegCurve
- GogExpRegCurve
- GogPowerRegCurve
- GogLogRegCurve
- GogPolynomRegCurve
- GogMovingAvg
- GogExpSmooth

The critical warning is like:
(go-demo:27047): GLib-GObject-WARNING **: cannot create instance of abstract (non-instantiatable) type `GogPlot'
Comment 2 Halton Huo 2008-08-13 09:35:56 UTC
I'm going change this patch based on Jean Brefort's comment.

[quote]
I'd prefer to keep pie-demo.c as a very simple sample, and yours as
something more involved.

You commented out the XLContourPlot and XLSurfacePlot types, just drop
them, they are just there for compatibility with the weird excel
surfaces and are not intended to be used in other cases.

One day, I should write a tutorial...
[/quote]
Comment 3 Halton Huo 2008-08-13 09:37:57 UTC
Created attachment 116487 [details] [review]
patch for bug #547408

Keep pie-demo for simple reference, add go-demo for more involved.
Comment 4 Jody Goldberg 2008-08-19 11:01:47 UTC
Comment on attachment 116487 [details] [review]
patch for bug #547408

I like the idea.  Please commit after converting the C++ comments to C or using ifdefs.

Thanks.
Comment 5 Jean Bréfort 2008-08-19 12:19:34 UTC
Nice work.

You might also remove the child variable from main, since it is not used:
go-demo.c: In function ‘main’:
go-demo.c:214: warning: unused variable ‘child’

It might be possible to add option boxes to the various samples to show how a new object (legend, title, trend line...) can be added or how the styles can be altered.
Comment 6 Halton Huo 2008-08-22 03:22:39 UTC
Created attachment 117168 [details]
screeshot for GogPiePlot
Comment 7 Halton Huo 2008-08-22 03:23:18 UTC
Created attachment 117169 [details]
screeshot for GogSurfacePlot
Comment 8 Halton Huo 2008-08-22 03:25:48 UTC
committed.

Beside removing the C++ comments and unused variable ‘child’, I add new function to allow user change data through go-demo, please check the screenshots. 
Comment 9 Jean Bréfort 2008-08-22 06:36:19 UTC
Very nice.