1 /*
2  * gog-plot.h :
3  *
4  * Copyright (C) 2003-2004 Jody Goldberg (jody@gnome.org)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) version 3.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
19  * USA
20  */
21 #ifndef GOG_PLOT_H
22 #define GOG_PLOT_H
23 
24 #include <goffice/goffice.h>
25 
26 G_BEGIN_DECLS
27 
28 typedef struct {
29 	struct _GogPlotBound {
30 		double minima, maxima;
31 	} val, logical;
32 	gboolean is_discrete;
33 	gboolean center_on_ticks;
34 	GOFormat *fmt;
35 
36 	const GODateConventions *date_conv;
37 } GogPlotBoundInfo;
38 
39 #define GOG_TYPE_PLOT	(gog_plot_get_type ())
40 #define GOG_PLOT(o)	(G_TYPE_CHECK_INSTANCE_CAST ((o), GOG_TYPE_PLOT, GogPlot))
41 #define GOG_IS_PLOT(o)	(G_TYPE_CHECK_INSTANCE_TYPE ((o), GOG_TYPE_PLOT))
42 
43 GType	  gog_plot_get_type (void);
44 GogPlot  *gog_plot_new_by_type	(GogPlotType const *type);
45 GogPlot  *gog_plot_new_by_name	(char const *id);
46 
47 void	  gog_plot_request_cardinality_update 	(GogPlot *plot);
48 void 	  gog_plot_update_cardinality 		(GogPlot *plot, int index_num);
49 void	  gog_plot_get_cardinality 		(GogPlot *plot,
50 						 unsigned *full, unsigned *visible);
51 void      gog_plot_foreach_elem    (GogPlot *plot, gboolean only_visible,
52 				    GogEnumFunc handler, gpointer data);
53 GSList const *gog_plot_get_series  (GogPlot const *plot);
54 GOData	 *gog_plot_get_axis_bounds (GogPlot *plot, GogAxisType axis,
55 				    GogPlotBoundInfo *bounds);
56 
57 gboolean  gog_plot_supports_vary_style_by_element (GogPlot const *plot);
58 
59 GogSeries	  *gog_plot_new_series	  (GogPlot *plot);
60 GogPlotDesc const *gog_plot_description	  (GogPlot const *plot);
61 
62 GogAxisSet gog_plot_axis_set_pref	(GogPlot const *plot);
63 gboolean   gog_plot_axis_set_is_valid	(GogPlot const *plot, GogAxisSet type);
64 gboolean   gog_plot_axis_set_assign	(GogPlot *plot, GogAxisSet type);
65 void	   gog_plot_axis_clear		(GogPlot *plot, GogAxisSet filter);
66 GogAxis	  *gog_plot_get_axis		(GogPlot const *plot, GogAxisType type);
67 void	   gog_plot_set_axis		(GogPlot *plot, GogAxis *axis);
68 
69 void 	   gog_plot_update_3d 		(GogPlot *plot);
70 
71 void	   gog_plot_guru_helper		(GogPlot *plot);
72 void	   gog_plot_clear_series	(GogPlot *plot);
73 
74 int        gog_plot_view_get_data_at_point (GogPlotView *view,
75 					    double x, double y, GogSeries **series);
76 double	   gog_plot_get_percent_value   (GogPlot *plot, unsigned series, unsigned index);
77 
78 G_END_DECLS
79 
80 #endif /* GOG_PLOT_H */
81