Re: Add data to a GogBarColPlot with stacked columns



To remove a GogObject*, you might use:
gog_object_clear_parent (obj);
g_object_unref (obj);

Le vendredi 25 avril 2008 à 12:17 +0200, Antonio Álvarez Feijoo a
écrit :
Thanks a lot, I was desperate... :)

Another problem that I still having is that I don't know how to remove the
content of the widget (title, chart, legend, etc) to paint another
different chart inside.

If someone could help me I will be grateful :)


for 1. you need to create a second series, somethings as (not tested):

GogPlot *col =      (GogPlot *) gog_plot_new_by_name ("GogBarColPlot");
g_object_set (col, "type", "stacked", NULL);
GogSeries *series = gog_plot_new_series (col);
   gchar ** t_legends;
t_legends = g_new (gchar*, n_max_datetimes);
/* ... */
data = go_data_vector_str_new (t_legends, 4, g_free);
gog_series_set_dim (series, 0, data, &error);
gdouble *t_values_1;
t_values_1 = g_new (gdouble, 4);
t_values_1[0] = 20;
t_values_1[1] = 20;
t_values_1[2] = 20;
t_values_1[3] = 0;
data = go_data_vector_val_new (t_values_1, 4, g_free);
gog_series_set_dim (series, 1, data, &error);
series = gog_plot_new_series (col);
t_values_1 = g_new (gdouble, 4);
t_values_1[0] = 50;
t_values_1[1] = 50;
t_values_1[2] = 0;
t_values_1[3] = 30;
data = go_data_vector_val_new (t_values_1, 4, g_free);
gog_series_set_dim (series, 1, data, &error);










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