GNOME Bugzilla – Bug 547408
rewrite tests/pie-demo.c to contain more tests
Last modified: 2008-08-22 06:36:19 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.
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'
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]
Created attachment 116487 [details] [review] patch for bug #547408 Keep pie-demo for simple reference, add go-demo for more involved.
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.
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.
Created attachment 117168 [details] screeshot for GogPiePlot
Created attachment 117169 [details] screeshot for GogSurfacePlot
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.
Very nice.