cxGeoPlotLegendAdd - adds a legend to the current plot
#include <cx/Geometry.h> cxErrorCode cxGeoPlotLegendAdd (float *start, float *end, const char *title)
- An array of two floating point numbers (interpreted as (x,y) coordinates), defining the bottom left-hand corner of the legend.
- An array of two floating point numbers (interpreted as (x,y) coordinates), defining the top right-hand corner of the legend.
- A string which is used as the caption for the legend.
cxGeoPlotLegendAdd returns an error code, an enumerated integer with cx_err_none (zero) indicating success. Any other value indicates the absence of a prior call to cxGeoPlotBegin, or an attempt to add a legend to a plot which has no datasets. A description of the error can be obtained by immediately calling cxGeoPlotGetLastError.
This function adds a legend to the current plot, located at (start, end). Here, the coordinates of the legend are in the same units as the coordinates specifying the location of the plot (which are set by cxGeoPlotDefine).
The legend contains an entry for all of the datasets that have been added to the current plot prior to the call of this function. The legend uses the plotting style for each dataset, together with the string identifying each one (all of which are set using cxGeoPlotDataAdd* routines). The caption of the legend (placed at the top of the legend area) is set using the title string.
The source of the LineGraph module may be found in $EXPLORERHOME/src/LineGraph/linegraph.c on UNIX machines, and %EXPLORERHOME%\src\LineGraph\linegraph.c on Windows machines. It illustrates the use of many of the cxGeoPlot* routines.
[ Documentation Home ]