# XRT/graph: Powerful 2D Charting Widget

XRT/graph can create various basic graphs types such as bar, XY plot, pie and area, as well as much more advanced graphs. With more than 200 resources, XRT/graph enables you to precisely control the look and behavior of your charts.

## Graph Data

Any data from any source can be graphed. XRT/graph provides functions to allocate and manipulate C data structures containing data. Also data can be loaded from text files. XRT/graph can also handle missing data, or "holes".

## Graph Types

Basic graph types are line, area, bar, stacking bar, pie, hi-low, candle, polar and radar. Two kinds of graphs can be combined to make compound graphs. Various types of graphs can be constructed from these basic types using resources. Bar and pie graphs can be displayed with a 3D effect. The depth, inclination and rotation can be set by resources and users can control them interactively. There are many styles, sizes and colors available for lines and points in line graphs. Scatter plots, strip charts, vector charts and impulse charts can be created using these flexible resources.

## Graph Components

### axis

Axis resources include minimum and maximum values for the X and Y axes, origin, precision, axis labels and ticks, and grid line increment. If values for these resources are not specified, they will be determined automatically. Various formats for the axes are available including currency, percentage and scientific notation. Logarithmic axis, time axis and two y-axes are also supported.

### header and footer

Multiple lines of text can be positioned in the graph header and footer.

### text area

Multiple lines of text can be attached to data and pixel coordinates. Text alignment can be specified for the text area.

### legend

The graph legend can be displayed vertically or horizontally, and positioned using an anchor.

## Real-time Update

XRT/graph is very fast. This allows it to respond to real-time data. XRT/graph has been used to display real-time information in science, financial and network monitoring applications where data is updated several times per second.

## User Interaction

### zoom, scaling, translation and rotation

End-users of XRT/graph applications can zoom, scale, translate and rotate graphs interactively using the keyboard or mouse. This functionality is available to all graphs developed with XRT/graph. The default actions can be customized by the programmer or end-user.

### feedback

XRT/graph has feedback routines which return the location of a user mouse event. The map() function maps mouse events to graph co-ordinates. The pick() function determines the closest data point to the mouse event.

## Property Editor

XRT/graph includes a property editor, allowing graphs to be designed without programming. The property editor can generate C source code and/or a resource file. The source code of the property editor is also provided.

## Other functions

Double buffering, K&R C/ANSI C/C++ binding, resource conversion programs. More examples of graphs which have been created with XRT/graph can be found here.

More examples of graphs which have been created with XRT/graph can be found here.