Re: Goffice: Axis labels and other text elements

Le jeudi 02 septembre 2010 à 12:58 +0200, Jon Nordby a écrit :
I want to add labels to the x and y axis of an AreaPlot. I suspect this
folllows the same idiom as for adding a title (which is show in
tests/pie-demo.c), but what is the name(s) to add as?

GogObject *label = gog_object_add_by_name (GOG_OBJECT (axis), "Label", NULL);

More generally, you can look at the 'static GogObjectRole const roles[]'
in the *_class_init() function for the appropriate class.

Also, how can I add several "titles" to a plot? I'd like to have a main
title and a subtitle, or something equivalent.

You can add as many titles as you want in the same way you add the first
title. This is also true for axis labels.

Playing with gnumeric shows that the position of a "text element", like
a title or a axis label can configured fairly extensively. How can I do
this using the GOffice APIs?

gboolean gog_object_set_position_flags (GogObject *obj, GogObjectPosition flags, GogObjectPosition mask);
void gog_object_set_manual_position (GogObject *obj, GogViewAllocation const *pos);

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