/** * gtk_databox_bars_new_full: * @maxlen: maximum length of @X and @Y * @len: actual number of @X and @Y values to plot * @X: array of horizontal position values of markers * @Y: array of vertical position values of markers * @xstart: the first element in the X array to plot (usually 0) * @ystart: the first element in the Y array to plot (usually 0) * @xstride: successive elements in the X array are separated by this much (1 if array, ncols if matrix) * @ystride: successive elements in the Y array are separated by this much (1 if array, ncols if matrix) * @xtype: the GType of the X array elements. G_TYPE_FLOAT, G_TYPE_DOUBLE, etc. * @ytype: the GType of the Y array elements. G_TYPE_FLOAT, G_TYPE_DOUBLE, etc. * @color: color of the markers * @size: marker size or line width (depending on the @type) * * Creates a new #GtkDataboxBars object which can be added to a #GtkDatabox widget * * Return value: A new #GtkDataboxBars object **/ GtkDataboxGraph * gtk_databox_bars_new_full (guint maxlen, guint len, void * X, guint xstart, guint xstride, GType xtype, void * Y, guint ystart, guint ystride, GType ytype, GdkRGBA * color, guint size) { GtkDataboxBars *bars; g_return_val_if_fail (X, NULL); g_return_val_if_fail (Y, NULL); g_return_val_if_fail ((len > 0), NULL); bars = g_object_new (GTK_DATABOX_TYPE_BARS, "X-Values", X, "Y-Values", Y, "xstart", xstart, "ystart", ystart, "xstride", xstride, "ystride", ystride, "xtype", xtype, "ytype", ytype, "length", len, "maxlen", maxlen, "color", color, "size", size, NULL); return GTK_DATABOX_GRAPH (bars); }
/** * gtk_databox_cross_simple_new: * @color: color of the markers * @size: marker size or line width (depending on the @type) * * Creates a new #GtkDataboxCrossSimple object which can be added to a #GtkDatabox widget as nice decoration for other graphs. * * Return value: A new #GtkDataboxCrossSimple object **/ GtkDataboxGraph * gtk_databox_cross_simple_new (GdkRGBA * color, guint size) { GtkDataboxCrossSimple *cross_simple; gfloat *X = g_new0 (gfloat, 2); gfloat *Y = g_new0 (gfloat, 2); gint len = 2; cross_simple = g_object_new (GTK_DATABOX_TYPE_CROSS_SIMPLE, "markers-type", GTK_DATABOX_MARKERS_SOLID_LINE, "X-Values", X, "Y-Values", Y, "xstart", 0, "ystart", 0, "xstride", 1, "ystride", 1, "xtype", G_TYPE_FLOAT, "ytype", G_TYPE_FLOAT, "length", len, "maxlen", len, "color", color, "size", size, NULL); gtk_databox_markers_set_position (GTK_DATABOX_MARKERS (cross_simple), 0, GTK_DATABOX_MARKERS_C); gtk_databox_markers_set_label (GTK_DATABOX_MARKERS (cross_simple), 0, GTK_DATABOX_MARKERS_TEXT_SW, "0", FALSE); gtk_databox_markers_set_position (GTK_DATABOX_MARKERS (cross_simple), 1, GTK_DATABOX_MARKERS_W); return GTK_DATABOX_GRAPH (cross_simple); }
static void grid_finalize (GObject * object) { GtkDataboxGraph *graph = GTK_DATABOX_GRAPH (object); /* Chain up to the parent class */ G_OBJECT_CLASS (gtk_databox_grid_parent_class)->finalize (object); }
/** * gtk_databox_grid_new: * @hlines: number of horizontal lines in the grid * @vlines: number of vertical lines in the grid * @color: color of the grid * @size: line width of the grid * * Creates a new #GtkDataboxGrid object which can be added to a #GtkDatabox widget as nice decoration for other graphs. * * Return value: A new #GtkDataboxGrid object **/ GtkDataboxGraph * gtk_databox_grid_new (gint hlines, gint vlines, GdkRGBA * color, guint size) { GtkDataboxGrid *grid; grid = g_object_new (GTK_DATABOX_TYPE_GRID, "color", color, "size", size, "grid-hlines", hlines, "grid-vlines", vlines, "grid-hline-vals",NULL, "grid-vline-vals", NULL, NULL); return GTK_DATABOX_GRAPH (grid); }
GtkDataboxGraph * gtk_databox_bars_new (gint len, gfloat *X, gfloat *Y, GdkColor *color, guint size) { GtkDataboxBars *bars; g_return_val_if_fail (X, NULL); g_return_val_if_fail (Y, NULL); g_return_val_if_fail ((len > 0), NULL); bars = g_object_new (GTK_DATABOX_TYPE_BARS, "X-Values", X, "Y-Values", Y, "length", len, "color", color, "size", size, NULL); return GTK_DATABOX_GRAPH (bars); }
GtkDataboxGraph * gtk_databox_marker_new (gint len, gfloat *X, gfloat *Y, GdkColor *color, guint size, GtkDataboxMarkerType type) { GtkDataboxMarker *marker; g_return_val_if_fail (X, NULL); g_return_val_if_fail (Y, NULL); g_return_val_if_fail ((len > 0), NULL); marker = g_object_new (GTK_DATABOX_TYPE_MARKER, "X-Values", X, "Y-Values", Y, "length", len, "color", color, "size", size, "marker-type", type, NULL); return GTK_DATABOX_GRAPH (marker); }
/** * gtk_databox_bars_new: * @len: length of @X and @Y * @X: array of horizontal position values of markers * @Y: array of vertical position values of markers * @color: color of the markers * @size: marker size or line width (depending on the @type) * * Creates a new #GtkDataboxBars object which can be added to a #GtkDatabox widget * * Return value: A new #GtkDataboxBars object **/ GtkDataboxGraph * gtk_databox_bars_new (guint len, gfloat * X, gfloat * Y, GdkRGBA * color, guint size) { GtkDataboxBars *bars; g_return_val_if_fail (X, NULL); g_return_val_if_fail (Y, NULL); g_return_val_if_fail ((len > 0), NULL); bars = g_object_new (GTK_DATABOX_TYPE_BARS, "X-Values", X, "Y-Values", Y, "xstart", 0, "ystart", 0, "xstride", 1, "ystride", 1, "xtype", G_TYPE_FLOAT, "ytype", G_TYPE_FLOAT, "length", len, "maxlen", len, "color", color, "size", size, NULL); return GTK_DATABOX_GRAPH (bars); }