[goffice] fixed box-plot axis labels update.



commit 0fcb804d49e1bd7bad392ff299f2acd21d0361c7
Author: Jean Brefort <jean brefort normalesup org>
Date:   Mon Jan 18 17:19:45 2010 +0100

    fixed box-plot axis labels update.

 ChangeLog                          |    3 +++
 plugins/plot_distrib/gog-boxplot.c |   13 ++++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c2b557c..0385191 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
 
 	* plugins/plot_distrib/gog-probability-plot.c
 	(gog_probability_plot_set_property): apply type change to all series.
+	* plugins/plot_distrib/gog-boxplot.c
+	(gog_box_plot_axis_get_bounds), (gog_box_plot_child_name_changed),
+	(gog_box_plot_class_init): fixed category axis update.
 
 2010-01-15  Jean Brefort  <jean brefort normalesup org>
 
diff --git a/plugins/plot_distrib/gog-boxplot.c b/plugins/plot_distrib/gog-boxplot.c
index 3212fa0..d7e5ab4 100644
--- a/plugins/plot_distrib/gog-boxplot.c
+++ b/plugins/plot_distrib/gog-boxplot.c
@@ -325,7 +325,6 @@ gog_box_plot_axis_get_bounds (GogPlot *plot, GogAxisType axis,
 		bounds->is_discrete = TRUE;
 		bounds->center_on_ticks = FALSE;
 		return has_names? GO_DATA (go_data_vector_str_new (model->names, n, g_free)): NULL;
-
 	} else {
 		bounds->val.minima = model->min;
 		bounds->val.maxima = model->max;
@@ -336,6 +335,17 @@ gog_box_plot_axis_get_bounds (GogPlot *plot, GogAxisType axis,
 }
 
 static void
+gog_box_plot_child_name_changed (GogObject const *obj, GogObject const *child)
+{
+	if (GOG_IS_SERIES (child)) {
+		GogBoxPlot *model = GOG_BOX_PLOT (obj);
+		GogAxis *axis = model->base.axis[(model->vertical)? 0: 1];
+		gog_axis_bound_changed (axis, GOG_OBJECT (obj));
+		gog_object_emit_changed (GOG_OBJECT (axis), TRUE);
+	}
+}
+
+static void
 gog_box_plot_finalize (GObject *obj)
 {
 	GogBoxPlot *plot = GOG_BOX_PLOT (obj);
@@ -384,6 +394,7 @@ gog_box_plot_class_init (GogPlotClass *gog_plot_klass)
 	gog_object_klass->type_name	= gog_box_plot_type_name;
 	gog_object_klass->view_type	= gog_box_plot_view_get_type ();
 	gog_object_klass->update	= gog_box_plot_update;
+	gog_object_klass->child_name_changed	= gog_box_plot_child_name_changed;
 #ifdef GOFFICE_WITH_GTK
 	gog_object_klass->populate_editor = gog_box_plot_populate_editor;
 #endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]