Top |
PocAxisPocAxis — Axis gadget for PocPlot |
GtkAdjustment * | adjustment | Read / Write |
gboolean | auto-interval | Read / Write |
PocAxisMode | axis-mode | Read / Write |
gfloat | label-size | Read / Write |
gchar * | legend | Read / Write |
gfloat | legend-size | Read / Write |
gdouble | lower-bound | Read / Write |
PocLineStyle | major-grid | Read / Write |
gdouble | major-interval | Read / Write |
guint | minor-divisions | Read / Write |
PocLineStyle | minor-grid | Read / Write |
gfloat | tick-size | Read / Write |
gdouble | upper-bound | Read / Write |
Each dataset added to a plot requires an X and Y axis. Several datasets may share axes. An axis controls the upper and lower bounds and the displayed portion of the plot data. If an axis is configured using a GtkAdjustment it may display a portion of its full range under control of the adjustment, otherwise it shows the full range between its lower and upper bounds.
Although axes contain drawing code, drawing always takes place under control of the PocPlot and on its canvas. Axes are vertical or horizontally orientated and are drawn at the appropriate edge of the plot depending on the associated dataset and plot surface. It is possible for the same axis to be shared on more than one plot and may be orientated differently on each. Axes are also responsible from drawing grid lines in the main plot area.
void poc_axis_set_axis_mode (PocAxis *self
,PocAxisMode axis_mode
);
Show axis as linear, octaves or decades.
PocAxisMode
poc_axis_get_axis_mode (PocAxis *self
);
Return the current axis mode.
void poc_axis_set_lower_bound (PocAxis *self
,gdouble bound
);
Set lower bound of range to plot on this axis.
gdouble
poc_axis_get_lower_bound (PocAxis *self
);
Get the lower bound of the axis range.
void poc_axis_set_upper_bound (PocAxis *self
,gdouble bound
);
Set upper bound of range to plot on this axis.
gdouble
poc_axis_get_upper_bound (PocAxis *self
);
Get the upper bound of the axis range.
void poc_axis_set_adjustment (PocAxis *self
,GtkAdjustment *adjustment
);
Set an adjustment to scroll between bounds on axis.
GtkAdjustment *
poc_axis_get_adjustment (PocAxis *self
);
Get the axis adjustment.
void poc_axis_set_major_interval (PocAxis *self
,gdouble interval
);
Set the major tick interval.
gdouble
poc_axis_get_major_interval (PocAxis *self
);
Get the major tick interval.
void poc_axis_set_auto_interval (PocAxis *self
,gboolean enabled
);
Automatically set major tick interval if enabled
is TRUE
.
gboolean
poc_axis_get_auto_interval (PocAxis *self
);
Get whether auto calculation of the major interval is enabled.
void poc_axis_set_minor_divisions (PocAxis *self
,guint divisions
);
Minor tick interval on this axis.
guint
poc_axis_get_minor_divisions (PocAxis *self
);
Get the minor tick interval.
void poc_axis_set_tick_size (PocAxis *self
,gfloat size
);
Set the tick size on this axis.
void poc_axis_set_label_size (PocAxis *self
,gfloat size
);
Set text size for tick label.
gfloat
poc_axis_get_label_size (PocAxis *self
);
Get text size for the tick label.
void poc_axis_set_major_grid (PocAxis *self
,PocLineStyle major_grid
);
Set the line style for major grid lines.
PocLineStyle
poc_axis_get_major_grid (PocAxis *self
);
Get the line style for major grid lines.
void poc_axis_set_minor_grid (PocAxis *self
,PocLineStyle minor_grid
);
Set the line style for minor grid lines.
PocLineStyle
poc_axis_get_minor_grid (PocAxis *self
);
Get the line style for minor grid lines.
void poc_axis_set_legend (PocAxis *self
,const gchar *legend
);
Set the legend text for the axis.
const gchar *
poc_axis_get_legend (PocAxis *self
);
Get the legend text for the axis.
void poc_axis_set_legend_size (PocAxis *self
,gfloat size
);
Set text size for the axis legend.
gfloat
poc_axis_get_legend_size (PocAxis *self
);
Get text size for the axis legend.
void poc_axis_draw_axis (PocAxis *self
,cairo_t *cr
,GtkOrientation orientation
,GtkPackType pack
,guint width
,guint height
,GtkStyleContext *style
);
Draw plot grid lines in main plot area. Used by PocPlot.
self |
A PocAxis |
|
cr |
A cairo_t |
|
orientation |
||
pack |
||
width |
Plot area width |
|
height |
Plot area height |
|
style |
void poc_axis_draw_grid (PocAxis *self
,cairo_t *cr
,GtkOrientation orientation
,guint width
,guint height
,GtkStyleContext *style
);
Draw plot grid lines in main plot area. Used by PocPlot.
self |
A PocAxis |
|
cr |
A cairo_t |
|
orientation |
||
width |
Plot area width |
|
height |
Plot area height |
|
style |
gdouble
poc_axis_size (PocAxis *self
);
Compute the width or height of the axis on the plot canvas. Used by PocPlot.
void poc_axis_configure (PocAxis *self
,PocAxisMode axis_mode
,gdouble lower_bound
,gdouble upper_bound
);
Set axis parameters in a single call.
void poc_axis_get_range (PocAxis *self
,gdouble *lower_bound
,gdouble *upper_bound
);
Get full axis range. The visible part of the axis may be less if scrolling.
void poc_axis_get_display_range (PocAxis *self
,gdouble *lower_bound
,gdouble *upper_bound
);
Get displayed axis range. This may be less than the full range if scrolling.
double poc_axis_linear_project (PocAxis *self
,gdouble value
,gint norm
);
Project a value from the dataset to pixel based position. The value is projected using linear interpolation between the axis limits. This function is intended for use in drawing code in subclasses of PocDataset
double poc_axis_project (PocAxis *self
,gdouble value
,gint norm
);
Project a value from the dataset to pixel based position. The value is interpreted according to the axis mode. This function is intended for use in drawing code in subclasses of PocDataset
“adjustment”
property“adjustment” GtkAdjustment *
Adjustment to scroll between bounds on axis.
Owner: PocAxis
Flags: Read / Write
“auto-interval”
property“auto-interval” gboolean
Automatically set major tick interval.
Owner: PocAxis
Flags: Read / Write
Default value: TRUE
“axis-mode”
property“axis-mode” PocAxisMode
Show axis as linear, octaves or decades.
Owner: PocAxis
Flags: Read / Write
Default value: POC_AXIS_LINEAR
“label-size”
property“label-size” gfloat
Text size for tick label.
Owner: PocAxis
Flags: Read / Write
Allowed values: [2,100]
Default value: 10
“legend”
property“legend” gchar *
Text for the axis legend.
Owner: PocAxis
Flags: Read / Write
Default value: NULL
“legend-size”
property“legend-size” gfloat
Text size for axis legend.
Owner: PocAxis
Flags: Read / Write
Allowed values: [2,100]
Default value: 14
“lower-bound”
property“lower-bound” gdouble
Lower bound of range to plot on this axis.
Owner: PocAxis
Flags: Read / Write
Allowed values: [-1e+06,1e+06]
Default value: 0
“major-grid”
property“major-grid” PocLineStyle
Line style for major grid lines.
Owner: PocAxis
Flags: Read / Write
Default value: POC_LINE_STYLE_SOLID
“major-interval”
property“major-interval” gdouble
Major tick interval.
Owner: PocAxis
Flags: Read / Write
Allowed values: [0,1e+06]
Default value: 10
“minor-divisions”
property“minor-divisions” guint
Minor tick interval on this axis.
Owner: PocAxis
Flags: Read / Write
Allowed values: [1,100]
Default value: 5
“minor-grid”
property“minor-grid” PocLineStyle
Line style for minor grid lines.
Owner: PocAxis
Flags: Read / Write
Default value: POC_LINE_STYLE_DASH
“tick-size”
property“tick-size” gfloat
Tick size on this axis.
Owner: PocAxis
Flags: Read / Write
Allowed values: [0,100]
Default value: 10
“upper-bound”
property“upper-bound” gdouble
Upper bound of range to plot on this axis.
Owner: PocAxis
Flags: Read / Write
Allowed values: [-1e+06,1e+06]
Default value: 1