Synopsis

#include <ntd-widgets.h>

struct              NtdPlot;

GtkWidget *         ntd_plot_new                        (void);
GtkWidget *         ntd_plot_new_with_data              (NtdPlotData *plot_data);

void                ntd_plot_add_data                   (NtdPlot *plot,
                                                         NtdPlotData *plot_data);
void                ntd_plot_set_window                 (NtdPlot *plot,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height);
void                ntd_plot_render                     (NtdPlot *plot,
                                                         cairo_t *cr);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkDrawingArea
                           +----NtdPlot

Implemented Interfaces

NtdPlot implements AtkImplementorIface and GtkBuildable.

Properties

  "window-height"            gdouble               : Read / Write
  "window-width"             gdouble               : Read / Write
  "window-x"                 gdouble               : Read / Write
  "window-y"                 gdouble               : Read / Write

Description

Details

struct NtdPlot

struct NtdPlot;

ntd_plot_new ()

GtkWidget *         ntd_plot_new                        (void);

Creates a new empty plot. This plot will have a default size of 100x100 pixels. You must add at least one NtdPlotData object to see something.

Returns :

the newly created widget.

ntd_plot_new_with_data ()

GtkWidget *         ntd_plot_new_with_data              (NtdPlotData *plot_data);

Creates a new plot with the specified set of data.

plot_data :

a NtdPlotData set of data.

Returns :

the newly created widget.

ntd_plot_add_data ()

void                ntd_plot_add_data                   (NtdPlot *plot,
                                                         NtdPlotData *plot_data);

ntd_plot_set_window ()

void                ntd_plot_set_window                 (NtdPlot *plot,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height);

Sets the window ranges to define which part of the plot must be shown. The graph will be redrawn accordling to the new window.

plot :

a ntdplot.

x :

the x value of the origin.

y :

the y value of the origin.

width :

the width of the window.

height :

the height of the window.

ntd_plot_render ()

void                ntd_plot_render                     (NtdPlot *plot,
                                                         cairo_t *cr);

Renders the NtdPlot to the given cairo_t context. Used to output the plot on context different from the Gtk ones (a printer, for instance).

plot :

an NtdPlot object.

cr :

a cairo_t object.

Property Details

The "window-height" property

  "window-height"            gdouble               : Read / Write

Height of the showing window (data coordinates).

Default value: 1


The "window-width" property

  "window-width"             gdouble               : Read / Write

Width of the showing window (data coordinates).

Default value: 1


The "window-x" property

  "window-x"                 gdouble               : Read / Write

X origin of the showing window (data coordinates).

Default value: 0


The "window-y" property

  "window-y"                 gdouble               : Read / Write

Y origin of the showing window (data coordinates).

Default value: 0