goffice r2099 - in branches/goffice-0-6: . goffice/graph pixmaps plugins/plot_boxes plugins/plot_xy
- From: jbrefort svn gnome org
- To: svn-commits-list gnome org
- Subject: goffice r2099 - in branches/goffice-0-6: . goffice/graph pixmaps plugins/plot_boxes plugins/plot_xy
- Date: Fri, 30 May 2008 14:49:37 +0000 (UTC)
Author: jbrefort
Date: Fri May 30 14:49:37 2008
New Revision: 2099
URL: http://svn.gnome.org/viewvc/goffice?rev=2099&view=rev
Log:
2008-05-30 Jean Brefort <jean brefort normalesup org>
* goffice/graph/gog-renderer.c: (_draw_circle),
(gog_renderer_draw_circle), (gog_renderer_stroke_circle),
(gog_renderer_fill_circle): new utilities.
* goffice/graph/gog-renderer.h: ditto.
* pixmaps/Makefile.am: add new pixmaps for box-plots
excluding outliers.
* pixmaps/chart_boxplot_2_1.png: ditto.
* pixmaps/chart_boxplot_2_1.svg: ditto.
* pixmaps/chart_boxplot_2_2.png: ditto.
* pixmaps/chart_boxplot_2_2.svg: ditto.
* plugins/plot_boxes/gog-boxplot-prefs.glade: add new properties.
* plugins/plot_boxes/gog-boxplot.c: (cb_outliers_changed),
(cb_ratio_changed), (gog_box_plot_pref),
(gog_box_plot_set_property), (gog_box_plot_get_property),
(gog_box_plot_class_init), (gog_box_plot_init),
(gog_box_plot_view_render), (gog_box_plot_series_update),
(gog_box_plot_series_finalize), (gog_box_plot_series_class_init):
ditto, fixes #534642.
* plugins/plot_boxes/plot-types.xml.in: new boxplots sub-types.
* plugins/plot_xy/gog-xy.c: (gog_xy_view_render): use
gog_renderer_draw_circle for bubbles.
Added:
branches/goffice-0-6/pixmaps/chart_boxplot_2_1.png (contents, props changed)
branches/goffice-0-6/pixmaps/chart_boxplot_2_1.svg
branches/goffice-0-6/pixmaps/chart_boxplot_2_2.png (contents, props changed)
branches/goffice-0-6/pixmaps/chart_boxplot_2_2.svg
Modified:
branches/goffice-0-6/ChangeLog
branches/goffice-0-6/NEWS
branches/goffice-0-6/goffice/graph/gog-renderer.c
branches/goffice-0-6/goffice/graph/gog-renderer.h
branches/goffice-0-6/pixmaps/Makefile.am
branches/goffice-0-6/plugins/plot_boxes/gog-boxplot-prefs.glade
branches/goffice-0-6/plugins/plot_boxes/gog-boxplot.c
branches/goffice-0-6/plugins/plot_boxes/plot-types.xml.in
branches/goffice-0-6/plugins/plot_xy/gog-xy.c
Modified: branches/goffice-0-6/NEWS
==============================================================================
--- branches/goffice-0-6/NEWS (original)
+++ branches/goffice-0-6/NEWS Fri May 30 14:49:37 2008
@@ -1,3 +1,9 @@
+goffice 0.6.4s:
+Jean:
+ * New boxplot feature requested: exclude outliers. [#534642]
+ * Fixed plot types activation/deactivation issues.
+
+--------------------------------------------------------------------------
goffice 0.6.3:
Hiroyuki Ikezoe:
Modified: branches/goffice-0-6/goffice/graph/gog-renderer.c
==============================================================================
--- branches/goffice-0-6/goffice/graph/gog-renderer.c (original)
+++ branches/goffice-0-6/goffice/graph/gog-renderer.c Fri May 30 14:49:37 2008
@@ -829,6 +829,54 @@
grc_draw_path (rend, NULL, path, FALSE);
}
+static void
+_draw_circle (GogRenderer *rend, double x, double y, double r, gboolean fill, gboolean stroke)
+{
+ GogStyle const *style;
+ GOPath *path;
+ gboolean narrow = r < 1.5;
+ double o, o_2;
+
+ g_return_if_fail (IS_GOG_RENDERER (rend));
+ g_return_if_fail (IS_GOG_STYLE (rend->cur_style));
+
+ style = rend->cur_style;
+ narrow |= !gog_style_is_outline_visible (style);
+
+ path = go_path_new ();
+ go_path_set_options (path, GO_PATH_OPTIONS_SHARP);
+
+ if (!narrow) {
+ o = gog_renderer_line_size (rend, style->outline.width);
+ o_2 = o / 2.;
+ } else
+ o = o_2 = 0.;
+
+ go_path_arc (path, x, y, r, r, 0, 2 * M_PI);
+
+ _draw_shape (rend, path, fill, stroke && !narrow);
+
+ go_path_free (path);
+}
+
+void
+gog_renderer_draw_circle (GogRenderer *rend, double x, double y, double r)
+{
+ _draw_circle (rend, x, y, r, TRUE, TRUE);
+}
+
+void
+gog_renderer_stroke_circle (GogRenderer *rend, double x, double y, double r)
+{
+ _draw_circle (rend, x, y, r, FALSE, TRUE);
+}
+
+void
+gog_renderer_fill_circle (GogRenderer *rend, double x, double y, double r)
+{
+ _draw_circle (rend, x, y, r, TRUE, FALSE);
+}
+
/**
* gog_renderer_draw_rectangle:
* @rend: a #GogRenderer
Modified: branches/goffice-0-6/goffice/graph/gog-renderer.h
==============================================================================
--- branches/goffice-0-6/goffice/graph/gog-renderer.h (original)
+++ branches/goffice-0-6/goffice/graph/gog-renderer.h Fri May 30 14:49:37 2008
@@ -101,6 +101,10 @@
void gog_renderer_stroke_shape (GogRenderer *renderer, GOPath const *path);
void gog_renderer_fill_shape (GogRenderer *renderer, GOPath const *path);
+void gog_renderer_draw_circle (GogRenderer *rend, double x, double y, double r);
+void gog_renderer_stroke_circle (GogRenderer *rend, double x, double y, double r);
+void gog_renderer_fill_circle (GogRenderer *rend, double x, double y, double r);
+
void gog_renderer_draw_rectangle (GogRenderer *rend, GogViewAllocation const *rect);
void gog_renderer_stroke_rectangle (GogRenderer *rend, GogViewAllocation const *rect);
void gog_renderer_fill_rectangle (GogRenderer *rend, GogViewAllocation const *rect);
Modified: branches/goffice-0-6/pixmaps/Makefile.am
==============================================================================
--- branches/goffice-0-6/pixmaps/Makefile.am (original)
+++ branches/goffice-0-6/pixmaps/Makefile.am Fri May 30 14:49:37 2008
@@ -35,6 +35,7 @@
chart_colored_1_1.png \
chart_contour_1_1.png \
chart_boxplot_1_1.png chart_boxplot_1_2.png \
+ chart_boxplot_2_1.png chart_boxplot_2_2.png \
chart_dropbar_1_1.png chart_dropbar_1_2.png \
chart_minmax_1_1.png chart_minmax_1_2.png \
chart_minmax_2_1.png chart_minmax_2_2.png \
Added: branches/goffice-0-6/pixmaps/chart_boxplot_2_1.png
==============================================================================
Binary file. No diff available.
Added: branches/goffice-0-6/pixmaps/chart_boxplot_2_1.svg
==============================================================================
--- (empty file)
+++ branches/goffice-0-6/pixmaps/chart_boxplot_2_1.svg Fri May 30 14:49:37 2008
@@ -0,0 +1,290 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ id="svg1"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ width="64.000000mm"
+ height="59.999998mm"
+ sodipodi:docbase="/home/gnome/head/gnumeric-head/src/cut-n-paste-code/goffice/pixmaps"
+ sodipodi:docname="chart_boxplot_2_1.svg"
+ inkscape:export-filename="/home/jean/devel/svn/goffice-orig/pixmaps/chart_boxplot_2_1.png"
+ inkscape:export-xdpi="25.4"
+ inkscape:export-ydpi="25.4"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs3">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 106.29921 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="226.77165 : 106.29921 : 1"
+ inkscape:persp3d-origin="113.38583 : 70.86614 : 1"
+ id="perspective2512" />
+ <linearGradient
+ id="linearGradient4044">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="0.0000000"
+ id="stop4045" />
+ <stop
+ style="stop-color:#363636;stop-opacity:0.18750000;"
+ offset="1.0000000"
+ id="stop4046" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3418">
+ <stop
+ style="stop-color:#f7f7f7;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop3419" />
+ <stop
+ style="stop-color:#dedede;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3420" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2791">
+ <stop
+ style="stop-color:#fbfbfb;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2792" />
+ <stop
+ style="stop-color:#e9e9e9;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2793" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2791"
+ id="linearGradient2794"
+ x1="0.49693251"
+ y1="0.058441557"
+ x2="0.49079755"
+ y2="0.96103895" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3418"
+ id="linearGradient3417"
+ x1="114.60959"
+ y1="35.200919"
+ x2="113.68569"
+ y2="186.26885"
+ gradientTransform="scale(1.046497,0.955569)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4044"
+ id="linearGradient4043"
+ x1="0.49689442"
+ y1="0.012987013"
+ x2="0.49689442"
+ y2="0.99350649" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0000000"
+ inkscape:pageshadow="2"
+ inkscape:zoom="4.4593316"
+ inkscape:cx="104.8376"
+ inkscape:cy="102.51871"
+ inkscape:window-width="1270"
+ inkscape:window-height="885"
+ showborder="true"
+ showgrid="true"
+ inkscape:grid-points="true"
+ inkscape:grid-bbox="true"
+ gridtolerance="0.99999999px"
+ inkscape:guide-bbox="true"
+ inkscape:guide-points="true"
+ guidetolerance="1.0000000mm"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ showguides="true"
+ inkscape:current-layer="svg1"
+ inkscape:document-units="mm">
+ <sodipodi:guide
+ orientation="vertical"
+ position="23.994627"
+ id="guide5924" />
+ <sodipodi:guide
+ orientation="vertical"
+ position="58.080453"
+ id="guide5925" />
+ <sodipodi:guide
+ orientation="vertical"
+ position="92.166278"
+ id="guide5926" />
+ <sodipodi:guide
+ orientation="vertical"
+ position="126.25210"
+ id="guide5927" />
+ <inkscape:grid
+ id="GridFromPre046Settings"
+ type="xygrid"
+ originx="0px"
+ originy="0.50000000mm"
+ spacingx="1.0000000mm"
+ spacingy="1.0000000mm"
+ color="#0000ff"
+ empcolor="#0000ff"
+ opacity="0.2"
+ empopacity="0.4"
+ empspacing="5" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <rect
+ style="fill:url(#linearGradient4043);fill-opacity:1.0;fill-rule:evenodd;stroke:none;stroke-width:3.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;"
+ id="rect4047"
+ width="184.25197"
+ height="177.15660"
+ x="23.031496"
+ y="23.040251"
+ rx="17.594519"
+ ry="14.164467" />
+ <rect
+ style="fill:url(#linearGradient4043);fill-opacity:1.0;fill-rule:evenodd;stroke:none;stroke-width:3.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;"
+ id="rect3421"
+ width="177.16536"
+ height="173.62204"
+ x="26.574802"
+ y="23.031490"
+ rx="17.594519"
+ ry="14.164467" />
+ <rect
+ style="fill:url(#linearGradient2794);fill-opacity:1.0;fill-rule:evenodd;stroke:none;stroke-width:3.5262673;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000;"
+ id="rect2169"
+ width="170.38249"
+ height="159.80026"
+ x="30.118111"
+ y="26.554472"
+ rx="17.594519"
+ ry="14.164467" />
+ <rect
+ style="fill:url(#linearGradient3417);fill-opacity:1.0;fill-rule:evenodd;stroke:none;stroke-width:3.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
+ id="rect3416"
+ width="163.39728"
+ height="149.19994"
+ x="31.955462"
+ y="31.923483"
+ rx="17.594519"
+ ry="14.164467" />
+ <rect
+ style="fill:none;fill-opacity:1.0;fill-rule:evenodd;stroke:#000000;stroke-width:3.5300000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000;stroke-dasharray:none"
+ id="rect5928"
+ width="170.38249"
+ height="159.80026"
+ x="29.993284"
+ y="26.574797"
+ rx="17.594519"
+ ry="14.164467" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.77613378;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 57.789332,68.854889 L 149.61117,68.854889"
+ id="path1738" />
+ <rect
+ style="fill:#d1940c;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.0816884;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ id="rect6929"
+ width="36.956661"
+ height="25.833538"
+ x="50.37656"
+ y="-129.18558"
+ transform="matrix(0,1,-1,0,0,0)" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.56783056;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 118.43274,51.03603 L 118.68853,86.67375"
+ id="path1111" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.54330754;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 58.080453,56.466309 L 58.360763,81.243469"
+ id="path1735" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.54330659;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 149.28662,56.407221 L 149.56693,81.302558"
+ id="path1736" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.54330707;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 76.737064,143.50092 L 193.11024,143.50092"
+ id="path2363" />
+ <rect
+ style="fill:#83a67f;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:3.5433078;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"
+ id="rect6930"
+ width="35.439133"
+ height="53.149246"
+ x="125.78136"
+ y="-161.22014"
+ transform="matrix(5.487796e-18,1.000000,-1.000000,1.328386e-17,0.000000,0.000000)" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.54330635;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 136.13701,126.58416 L 136.41732,160.41768"
+ id="path1733" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.54330683;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 75.900792,131.03112 L 76.181102,155.97072"
+ id="path1734" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.54330754;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 193.11024,130.9911 L 193.39055,156.01074"
+ id="path1737" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#f9940c;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="path2431"
+ sodipodi:cx="3.102036"
+ sodipodi:cy="55.362526"
+ sodipodi:rx="3.102036"
+ sodipodi:ry="3.102036"
+ d="M 6.204072,55.362526 A 3.102036,3.102036 0 1 1 0,55.362526 A 3.102036,3.102036 0 1 1 6.204072,55.362526 z"
+ transform="translate(39.85892,13.492364)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#f9940c;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="path3293"
+ sodipodi:cx="3.102036"
+ sodipodi:cy="55.362526"
+ sodipodi:rx="3.102036"
+ sodipodi:ry="3.102036"
+ d="M 6.204072,55.362526 A 3.102036,3.102036 0 1 1 0,55.362526 A 3.102036,3.102036 0 1 1 6.204072,55.362526 z"
+ transform="translate(165.0846,13.492364)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="path2464"
+ sodipodi:cx="3.102036"
+ sodipodi:cy="55.362526"
+ sodipodi:rx="3.102036"
+ sodipodi:ry="3.102036"
+ d="M 6.204072,55.362526 A 3.102036,3.102036 0 1 1 0,55.362526 A 3.102036,3.102036 0 1 1 6.204072,55.362526 z"
+ transform="translate(187.79528,13.492364)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#83a67f;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="path3236"
+ sodipodi:cx="3.102036"
+ sodipodi:cy="55.362526"
+ sodipodi:rx="3.102036"
+ sodipodi:ry="3.102036"
+ d="M 6.204072,55.362526 A 3.102036,3.102036 0 1 1 0,55.362526 A 3.102036,3.102036 0 1 1 6.204072,55.362526 z"
+ transform="translate(54.032148,88.138397)" />
+</svg>
Added: branches/goffice-0-6/pixmaps/chart_boxplot_2_2.png
==============================================================================
Binary file. No diff available.
Added: branches/goffice-0-6/pixmaps/chart_boxplot_2_2.svg
==============================================================================
--- (empty file)
+++ branches/goffice-0-6/pixmaps/chart_boxplot_2_2.svg Fri May 30 14:49:37 2008
@@ -0,0 +1,288 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ id="svg1"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ width="64.000000mm"
+ height="59.999998mm"
+ sodipodi:docbase="/home/gnome/head/gnumeric-head/src/cut-n-paste-code/goffice/pixmaps"
+ sodipodi:docname="chart_boxplot_2_2.svg"
+ inkscape:export-filename="/home/jean/devel/svn/goffice-orig/pixmaps/chart_boxplot_2_2.png"
+ inkscape:export-xdpi="25.4"
+ inkscape:export-ydpi="25.4"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs3">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 106.29921 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="226.77165 : 106.29921 : 1"
+ inkscape:persp3d-origin="113.38583 : 70.86614 : 1"
+ id="perspective2512" />
+ <linearGradient
+ id="linearGradient4044">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="0.0000000"
+ id="stop4045" />
+ <stop
+ style="stop-color:#363636;stop-opacity:0.18750000;"
+ offset="1.0000000"
+ id="stop4046" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3418">
+ <stop
+ style="stop-color:#f7f7f7;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop3419" />
+ <stop
+ style="stop-color:#dedede;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3420" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2791">
+ <stop
+ style="stop-color:#fbfbfb;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2792" />
+ <stop
+ style="stop-color:#e9e9e9;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2793" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2791"
+ id="linearGradient2794"
+ x1="0.49693251"
+ y1="0.058441557"
+ x2="0.49079755"
+ y2="0.96103895" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3418"
+ id="linearGradient3417"
+ x1="114.60959"
+ y1="35.200919"
+ x2="113.68569"
+ y2="186.26885"
+ gradientTransform="scale(1.046497,0.955569)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4044"
+ id="linearGradient4043"
+ x1="0.49689442"
+ y1="0.012987013"
+ x2="0.49689442"
+ y2="0.99350649" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0000000"
+ inkscape:pageshadow="2"
+ inkscape:zoom="3.2032223"
+ inkscape:cx="113.07364"
+ inkscape:cy="106.29921"
+ inkscape:window-width="1270"
+ inkscape:window-height="885"
+ showborder="true"
+ showgrid="true"
+ inkscape:grid-points="true"
+ inkscape:grid-bbox="true"
+ gridtolerance="0.99999999px"
+ inkscape:guide-bbox="true"
+ inkscape:guide-points="true"
+ guidetolerance="1.0000000mm"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ showguides="true"
+ inkscape:current-layer="svg1"
+ inkscape:document-units="mm">
+ <sodipodi:guide
+ orientation="vertical"
+ position="23.994627"
+ id="guide5924" />
+ <sodipodi:guide
+ orientation="vertical"
+ position="58.080453"
+ id="guide5925" />
+ <sodipodi:guide
+ orientation="vertical"
+ position="92.166278"
+ id="guide5926" />
+ <sodipodi:guide
+ orientation="vertical"
+ position="126.25210"
+ id="guide5927" />
+ <inkscape:grid
+ id="GridFromPre046Settings"
+ type="xygrid"
+ originx="0px"
+ originy="0.50000000mm"
+ spacingx="1.0000000mm"
+ spacingy="1.0000000mm"
+ color="#0000ff"
+ empcolor="#0000ff"
+ opacity="0.2"
+ empopacity="0.4"
+ empspacing="5" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <rect
+ style="fill:url(#linearGradient4043);fill-opacity:1.0;fill-rule:evenodd;stroke:none;stroke-width:3.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;"
+ id="rect4047"
+ width="184.25197"
+ height="177.15660"
+ x="23.031496"
+ y="23.040251"
+ rx="17.594519"
+ ry="14.164467" />
+ <rect
+ style="fill:url(#linearGradient4043);fill-opacity:1.0;fill-rule:evenodd;stroke:none;stroke-width:3.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;"
+ id="rect3421"
+ width="177.16536"
+ height="173.62204"
+ x="26.574802"
+ y="23.031490"
+ rx="17.594519"
+ ry="14.164467" />
+ <rect
+ style="fill:url(#linearGradient2794);fill-opacity:1.0;fill-rule:evenodd;stroke:none;stroke-width:3.5262673;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000;"
+ id="rect2169"
+ width="170.38249"
+ height="159.80026"
+ x="30.118111"
+ y="26.554472"
+ rx="17.594519"
+ ry="14.164467" />
+ <rect
+ style="fill:url(#linearGradient3417);fill-opacity:1.0;fill-rule:evenodd;stroke:none;stroke-width:3.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
+ id="rect3416"
+ width="163.39728"
+ height="149.19994"
+ x="31.955462"
+ y="31.923483"
+ rx="17.594519"
+ ry="14.164467" />
+ <rect
+ style="fill:none;fill-opacity:1.0;fill-rule:evenodd;stroke:#000000;stroke-width:3.5300000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000;stroke-dasharray:none"
+ id="rect5928"
+ width="170.38249"
+ height="159.80026"
+ x="29.993284"
+ y="26.574797"
+ rx="17.594519"
+ ry="14.164467" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.69489455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 79.362875,160.55633 L 79.362875,74.029901"
+ id="path1738" />
+ <rect
+ style="fill:#d1940c;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.02077103;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ id="rect6929"
+ width="36.956661"
+ height="24.343704"
+ x="60.884544"
+ y="93.277542" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.46342373;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 61.544015,103.41026 L 97.181735,103.16922"
+ id="path1111" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.43961835;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 66.974295,160.282 L 91.751455,160.01785"
+ id="path1735" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.4396174;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 66.915207,74.335734 L 91.810544,74.07159"
+ id="path1736" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.43961787;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 153.99804,142.70132 L 153.99804,33.039444"
+ id="path2363" />
+ <rect
+ style="fill:#83a67f;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.43961835;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ id="rect6930"
+ width="35.439133"
+ height="50.084103"
+ x="136.27847"
+ y="63.090427" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.43961716;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 137.08128,86.726999 L 170.9148,86.462855"
+ id="path1733" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.43961763;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 141.52824,143.48936 L 166.46784,143.22522"
+ id="path1734" />
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.43961835;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 141.48822,33.039444 L 166.50786,32.7753"
+ id="path1737" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#f9940c;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="path2431"
+ sodipodi:cx="3.102036"
+ sodipodi:cy="55.362526"
+ sodipodi:rx="3.102036"
+ sodipodi:ry="3.102036"
+ d="M 6.204072,55.362526 A 3.102036,3.102036 0 1 1 0,55.362526 A 3.102036,3.102036 0 1 1 6.204072,55.362526 z"
+ transform="translate(76.260839,3.8122305)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="path2464"
+ sodipodi:cx="3.102036"
+ sodipodi:cy="55.362526"
+ sodipodi:rx="3.102036"
+ sodipodi:ry="3.102036"
+ d="M 6.204072,55.362526 A 3.102036,3.102036 0 1 1 0,55.362526 A 3.102036,3.102036 0 1 1 6.204072,55.362526 z"
+ transform="translate(76.260839,-18.875228)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#83a67f;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="path3236"
+ sodipodi:cx="3.102036"
+ sodipodi:cy="55.362526"
+ sodipodi:rx="3.102036"
+ sodipodi:ry="3.102036"
+ d="M 6.204072,55.362526 A 3.102036,3.102036 0 1 1 0,55.362526 A 3.102036,3.102036 0 1 1 6.204072,55.362526 z"
+ transform="translate(150.896,113.95586)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#f9940c;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="path3238"
+ sodipodi:cx="3.102036"
+ sodipodi:cy="55.362526"
+ sodipodi:rx="3.102036"
+ sodipodi:ry="3.102036"
+ d="M 6.204072,55.362526 A 3.102036,3.102036 0 1 1 0,55.362526 A 3.102036,3.102036 0 1 1 6.204072,55.362526 z"
+ transform="translate(76.260839,119.5899)" />
+</svg>
Modified: branches/goffice-0-6/plugins/plot_boxes/gog-boxplot-prefs.glade
==============================================================================
--- branches/goffice-0-6/plugins/plot_boxes/gog-boxplot-prefs.glade (original)
+++ branches/goffice-0-6/plugins/plot_boxes/gog-boxplot-prefs.glade Fri May 30 14:49:37 2008
@@ -1,160 +1,156 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
<glade-interface>
-
-<widget class="GtkWindow" id="window1">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
-
- <child>
- <widget class="GtkTable" id="gog_box_plot_prefs">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Gap:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">gap_spinner</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">%</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="gap_spinner">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Separation between groups as a percentage of bar/col width</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">10</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">True</property>
- <property name="wrap">False</property>
- <property name="adjustment">0 0 500 10 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="layout-lbl">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Layout</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="layout">
- <property name="visible">True</property>
- <property name="items" translatable="yes">Horizontal
+ <widget class="GtkWindow" id="window1">
+ <property name="title" translatable="yes">window1</property>
+ <child>
+ <widget class="GtkTable" id="gog_box_plot_prefs">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">_Gap:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">gap_spinner</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">%</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="gap_spinner">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Separation between groups as a percentage of bar/col width</property>
+ <property name="adjustment">0 0 500 10 10 10</property>
+ <property name="climb_rate">10</property>
+ <property name="snap_to_ticks">True</property>
+ <property name="numeric">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="layout-lbl">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Layout</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="layout">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">Horizontal
Vertical</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="show-outliers">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Exclude and show outliers</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="diameter-label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Diameter/width:</property>
+ <property name="use_underline">True</property>
+ <property name="justify">GTK_JUSTIFY_RIGHT</property>
+ <property name="wrap_mode">PANGO_WRAP_WORD_CHAR</property>
+ </widget>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="diameter">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_text">Ratio of the diameter of the circles representing outliers versus the rectangle width.</property>
+ <property name="adjustment">25 0 50 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="diam-pc-label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">%</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</glade-interface>
Modified: branches/goffice-0-6/plugins/plot_boxes/gog-boxplot.c
==============================================================================
--- branches/goffice-0-6/plugins/plot_boxes/gog-boxplot.c (original)
+++ branches/goffice-0-6/plugins/plot_boxes/gog-boxplot.c Fri May 30 14:49:37 2008
@@ -31,6 +31,7 @@
#include <goffice/data/go-data-simple.h>
#include <goffice/math/go-rangefunc.h>
#include <goffice/math/go-math.h>
+#include <goffice/utils/go-marker.h>
#include <goffice/app/module-plugin-defs.h>
#include <glib/gi18n-lib.h>
@@ -45,8 +46,9 @@
unsigned num_series;
double min, max;
int gap_percentage;
- gboolean vertical;
+ gboolean vertical, outliers;
char const **names;
+ double radius_ratio;
};
static GogObjectClass *gog_box_plot_parent_klass;
@@ -58,6 +60,7 @@
#include <glade/glade-xml.h>
#include <gtk/gtkcombobox.h>
#include <gtk/gtkspinbutton.h>
+#include <gtk/gtktogglebutton.h>
#include <gtk/gtkenums.h>
static void
@@ -72,6 +75,36 @@
g_object_set (boxplot, "vertical", gtk_combo_box_get_active (box), NULL);
}
+static void
+cb_outliers_changed (GtkToggleButton *btn, GObject *boxplot)
+{
+ GladeXML *gui = GLADE_XML (g_object_get_data (G_OBJECT (btn), "state"));
+ GtkWidget *w;
+ gboolean outliers = gtk_toggle_button_get_active (btn);
+ if (outliers) {
+ w = glade_xml_get_widget (gui, "diameter-label");
+ gtk_widget_show (w);
+ w = glade_xml_get_widget (gui, "diameter");
+ gtk_widget_show (w);
+ w = glade_xml_get_widget (gui, "diam-pc-label");
+ gtk_widget_show (w);
+ } else {
+ w = glade_xml_get_widget (gui, "diameter-label");
+ gtk_widget_hide (w);
+ w = glade_xml_get_widget (gui, "diameter");
+ gtk_widget_hide (w);
+ w = glade_xml_get_widget (gui, "diam-pc-label");
+ gtk_widget_hide (w);
+ }
+ g_object_set (boxplot, "outliers", outliers, NULL);
+}
+
+static void
+cb_ratio_changed (GtkAdjustment *adj, GObject *boxplot)
+{
+ g_object_set (boxplot, "radius-ratio", adj->value / 200., NULL);
+}
+
static gpointer
gog_box_plot_pref (GogObject *obj,
GogDataAllocator *dalloc, GOCmdContext *cc)
@@ -97,6 +130,25 @@
gtk_combo_box_set_active (GTK_COMBO_BOX (w), boxplot->vertical);
g_signal_connect (w, "changed", G_CALLBACK (cb_layout_changed), boxplot);
+ w = glade_xml_get_widget (gui, "show-outliers");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), boxplot->outliers);
+ g_object_set_data (G_OBJECT (w), "state", gui);
+ g_signal_connect (w, "toggled", G_CALLBACK (cb_outliers_changed), boxplot);
+
+ w = glade_xml_get_widget (gui, "diameter");
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), boxplot->radius_ratio * 200.);
+ g_signal_connect (G_OBJECT (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (w))),
+ "value_changed",
+ G_CALLBACK (cb_ratio_changed), boxplot);
+
+ if (!boxplot->outliers) {
+ gtk_widget_hide (w);
+ w = glade_xml_get_widget (gui, "diameter-label");
+ gtk_widget_hide (w);
+ w = glade_xml_get_widget (gui, "diam-pc-label");
+ gtk_widget_hide (w);
+ }
+
w = glade_xml_get_widget (gui, "gog_box_plot_prefs");
g_object_set_data_full (G_OBJECT (w),
"state", gui, (GDestroyNotify)g_object_unref);
@@ -120,12 +172,16 @@
BOX_PLOT_PROP_0,
BOX_PLOT_PROP_GAP_PERCENTAGE,
BOX_PLOT_PROP_VERTICAL,
+ BOX_PLOT_PROP_OUTLIERS,
+ BOX_PLOT_PROP_RADIUS_RATIO,
};
typedef struct {
GogSeries base;
int gap_percentage;
double vals[5];
+ double *svals; //sorted data
+ int nb_valid;
} GogBoxPlotSeries;
typedef GogSeriesClass GogBoxPlotSeriesClass;
@@ -161,8 +217,14 @@
if (boxplot->base.axis[1])
gog_axis_bound_changed (boxplot->base.axis[1], GOG_OBJECT (boxplot));
break;
+ case BOX_PLOT_PROP_OUTLIERS:
+ boxplot->outliers = g_value_get_boolean (value);
+ break;
+ case BOX_PLOT_PROP_RADIUS_RATIO:
+ boxplot->radius_ratio = g_value_get_double (value);
+ break;
default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, param_id, pspec);
- return; /* NOTE : RETURN */
+ return; /* NOTE : RETURN */
}
gog_object_emit_changed (GOG_OBJECT (obj), TRUE);
}
@@ -180,8 +242,14 @@
case BOX_PLOT_PROP_VERTICAL:
g_value_set_boolean (value, boxplot->vertical);
break;
+ case BOX_PLOT_PROP_OUTLIERS:
+ g_value_set_boolean (value, boxplot->outliers);
+ break;
+ case BOX_PLOT_PROP_RADIUS_RATIO:
+ g_value_set_double (value, boxplot->radius_ratio);
+ break;
default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, param_id, pspec);
- break;
+ break;
}
}
@@ -302,6 +370,18 @@
_("Whether the box-plot should be vertical instead of horizontal"),
FALSE,
GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ g_object_class_install_property (gobject_klass, BOX_PLOT_PROP_OUTLIERS,
+ g_param_spec_boolean ("outliers",
+ _("Outliers"),
+ _("Whether outliers should be taken into account and displayed"),
+ FALSE,
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ g_object_class_install_property (gobject_klass, BOX_PLOT_PROP_RADIUS_RATIO,
+ g_param_spec_double ("radius-ratio",
+ _("Radius ratio"),
+ _("The ratio between the radius of the circles representing outliers and the rectangls widths"),
+ 0., 0.5, 0.125,
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
gog_object_klass->type_name = gog_box_plot_type_name;
gog_object_klass->view_type = gog_box_plot_view_get_type ();
@@ -330,6 +410,7 @@
gog_box_plot_init (GogBoxPlot *model)
{
model->gap_percentage = 150;
+ model->radius_ratio = 0.125;
}
GSF_DYNAMIC_CLASS (GogBoxPlot, gog_box_plot,
@@ -394,14 +475,62 @@
if (!gog_series_is_valid (GOG_SERIES (series)) ||
!go_data_vector_get_len (GO_DATA_VECTOR (series->base.values[0].data)))
continue;
- style = GOG_STYLED_OBJECT (series)->style;
+ style = gog_style_dup (GOG_STYLED_OBJECT (series)->style);
+ y = gog_axis_map_to_view (ser_map, num_ser);
gog_renderer_push_style (view->renderer, style);
- min = gog_axis_map_to_view (map, series->vals[0]);
+ if (model->outliers) {
+ double l1, l2, m1, m2, d, r = 2. * hrect * model->radius_ratio;
+ int i = 0;
+ style->outline = style->line;
+ d = series->vals[3] - series->vals[1];
+ l1 = series->vals[1] - d * 1.5;
+ l2 = series->vals[1] - d * 3.;
+ m1 = series->vals[3] + d * 1.5;
+ m2 = series->vals[3] + d * 3.;
+ while (series->svals[i] < l1) {
+ /* display the outlier as a mark */
+ d = gog_axis_map_to_view (map, series->svals[i]);
+ if (model->vertical) {
+ if (series->svals[i] < l2)
+ gog_renderer_stroke_circle (view->renderer, y, d, r);
+ else
+ gog_renderer_draw_circle (view->renderer, y, d, r);
+ } else {
+ if (series->svals[i] < l2)
+ gog_renderer_stroke_circle (view->renderer, d, y, r);
+ else
+ gog_renderer_draw_circle (view->renderer, d, y, r);
+ }
+ i++;
+ }
+ min = series->svals[i];
+ i = series->nb_valid - 1;
+ while (series->svals[i] > m1) {
+ /* display the outlier as a mark */
+ d = gog_axis_map_to_view (map, series->svals[i]);
+ if (model->vertical) {
+ if (series->svals[i] > m2)
+ gog_renderer_stroke_circle (view->renderer, y, d, r);
+ else
+ gog_renderer_draw_circle (view->renderer, y, d, r);
+ } else {
+ if (series->svals[i] > m2)
+ gog_renderer_stroke_circle (view->renderer, d, y, r);
+ else
+ gog_renderer_draw_circle (view->renderer, d, y, r);
+ }
+ i--;
+ }
+ max = series->svals[i];
+ } else {
+ min = series->vals[0];
+ max = series->vals[4];
+ }
+ min = gog_axis_map_to_view (map, min);
qu1 = gog_axis_map_to_view (map, series->vals[1]);
med = gog_axis_map_to_view (map, series->vals[2]);
qu3 = gog_axis_map_to_view (map, series->vals[3]);
- max = gog_axis_map_to_view (map, series->vals[4]);
- y = gog_axis_map_to_view (ser_map, num_ser);
+ max = gog_axis_map_to_view (map, max);
if (model->vertical) {
path[2].code = ART_LINETO;
path[0].y = path[3].y = path[4].y = qu1;
@@ -463,6 +592,7 @@
}
gog_renderer_draw_sharp_path (view->renderer, path);
gog_renderer_pop_style (view->renderer);
+ g_object_unref (style);
num_ser++;
}
gog_chart_map_free (chart_map);
@@ -491,6 +621,9 @@
GogBoxPlotSeries *series = GOG_BOX_PLOT_SERIES (obj);
unsigned old_num = series->base.num_elements;
+ g_free (series->svals);
+ series->svals = NULL;
+
if (series->base.values[0].data != NULL) {
vals = go_data_vector_get_values (GO_DATA_VECTOR (series->base.values[0].data));
len = go_data_vector_get_len
@@ -498,15 +631,16 @@
}
series->base.num_elements = len;
if (len > 0) {
- double *svals = g_new (double, len), x;
+ double x;
int n, max = 0;
+ series->svals = g_new (double, len);
for (n = 0; n < len; n++)
if (go_finite (vals[n]))
- svals[max++] = vals[n];
- go_range_fractile_inter_nonconst (svals, max, &series->vals[0], 0);
+ series->svals[max++] = vals[n];
+ go_range_fractile_inter_nonconst (series->svals, max, &series->vals[0], 0);
for (x = 0.25,n = 1; n < 5; n++, x+= 0.25)
- go_range_fractile_inter_sorted (svals, max, &series->vals[n], x);
- g_free (svals);
+ go_range_fractile_inter_sorted (series->svals, max, &series->vals[n], x);
+ series->nb_valid = max;
}
/* queue plot for redraw */
gog_object_request_update (GOG_OBJECT (series->base.plot));
@@ -526,11 +660,20 @@
}
static void
+gog_box_plot_series_finalize (GObject *obj)
+{
+ g_free (GOG_BOX_PLOT_SERIES (obj)->svals);
+ ((GObjectClass *) gog_box_plot_series_parent_klass)->finalize (obj);
+}
+
+static void
gog_box_plot_series_class_init (GogObjectClass *obj_klass)
{
+ GObjectClass *object_class = (GObjectClass *) obj_klass;
GogStyledObjectClass *gso_klass = (GogStyledObjectClass*) obj_klass;
gog_box_plot_series_parent_klass = g_type_class_peek_parent (obj_klass);
+ object_class->finalize = gog_box_plot_series_finalize;
obj_klass->update = gog_box_plot_series_update;
gso_klass->init_style = gog_box_plot_series_init_style;
}
Modified: branches/goffice-0-6/plugins/plot_boxes/plot-types.xml.in
==============================================================================
--- branches/goffice-0-6/plugins/plot_boxes/plot-types.xml.in (original)
+++ branches/goffice-0-6/plugins/plot_boxes/plot-types.xml.in Fri May 30 14:49:37 2008
@@ -15,6 +15,21 @@
<property name="vertical">true</property>
<property name="guru-hints">backplane</property>
</Type>
+ <Type _name="HBoxPlotOutliers" row="2" col="1"
+ engine="GogBoxPlot" family="BoxPlot"
+ _description="Horizontal Box-Plot showing outliers."
+ sample_image_file="chart_boxplot_2_1.png">
+ <property name="outliers">true</property>
+ <property name="guru-hints">backplane</property>
+ </Type>
+ <Type _name="VBoxPlotOutliers" row="2" col="2"
+ engine="GogBoxPlot" family="BoxPlot"
+ _description="Vertical Box-Plot showing outliers."
+ sample_image_file="chart_boxplot_2_2.png">
+ <property name="outliers">true</property>
+ <property name="vertical">true</property>
+ <property name="guru-hints">backplane</property>
+ </Type>
<Family _name="Histogram" sample_image_file="hist.xpm" axis_set="xy"/>
<Type _name="Histogram" row="1" col="1"
engine="GogHistogramPlot" family="Histogram"
Modified: branches/goffice-0-6/plugins/plot_xy/gog-xy.c
==============================================================================
--- branches/goffice-0-6/plugins/plot_xy/gog-xy.c (original)
+++ branches/goffice-0-6/plugins/plot_xy/gog-xy.c Fri May 30 14:49:37 2008
@@ -831,19 +831,6 @@
typedef GogPlotView GogXYView;
typedef GogPlotViewClass GogXYViewClass;
-#define MAX_ARC_SEGMENTS 64
-
-static void
-bubble_draw_circle (GogView *view, double x, double y, double radius)
-{
- GOPath *path;
-
- path = go_path_new ();
- go_path_pie_wedge (path, x, y, radius, radius, 0, 2 * M_PI);
- gog_renderer_draw_shape (view->renderer, path);
- go_path_free (path);
-}
-
static GOColor
get_map_color (double z, gboolean hide_outliers)
{
@@ -1110,7 +1097,7 @@
if (z < 0) {
if (GOG_BUBBLE_PLOT(model)->show_negatives) {
gog_renderer_push_style (view->renderer, neg_style);
- bubble_draw_circle (view, x_canvas, y_canvas,
+ gog_renderer_draw_circle (view->renderer, x_canvas, y_canvas,
((size_as_area) ?
sqrt (- z / zmax) :
- z / zmax) * rmax);
@@ -1120,7 +1107,7 @@
if (model->base.vary_style_by_element)
gog_theme_fillin_style (theme, style, GOG_OBJECT (series),
model->base.index_num + i - 1, FALSE);
- bubble_draw_circle (view, x_canvas, y_canvas,
+ gog_renderer_draw_circle (view->renderer, x_canvas, y_canvas,
((size_as_area) ?
sqrt (z / zmax) :
z / zmax) * rmax);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]