DPLOT Structure

The DPLOT structure contains format information for a graph: number of curves, number of points in each curve, line and symbol styles used, etc. It is used in calls to DPlot_Plot, DPlot_PlotToRect, and DPlot_PlotBitmap. This structure is defined in the header/include file accompanying the various source examples, and shown below using standard C syntax.
#define DPLOT_DDE_VERSION 3

// Version 3 of the structure allows 100 curves and 80 characters for legend strings,
// 40 for curve labels (same limits as DPlot)

#define MAXC 100             // Do NOT edit this value

typedef struct tagDPLOT
{
    DWORD Version;           // Caller must set this to DPLOT_DDE_VERSION
    DWORD hwnd;              // handle of client application window
                             // (Use DWORD rather than HWND)
    DWORD DataFormat;        // XY pairs, DX and Y, etc. (see below)
    DWORD MaxCurves;         // maximum number of curves (must be <= 100) for XY plots
                             // = NX for DataFormat = DATA_3D
                             //   ignore for DataFormat = DATA_3DR
    DWORD MaxPoints;         // maximum number of points/curve for XY plots
                             // = NY for DataFormat = DATA_3D
                             // = 3 * number of points for DATA_3DR
    DWORD NumCurves;         // actual number of curves, always 1 for
                             //   DATA_3D or DATA_3DR
    DWORD Scale;             // scaling code (Linear, Log, etc.) (see below)
    float LegendX;           // left coord of legend, expressed as a ratio
                             //    of plot size (0->1)
    float LegendY;           // top coord of legend
    DWORD NP[MAXC];          // actual number of points in each curve;
                             //   cannot exceed MaxPoints.
    DWORD LineType[MAXC];    // line types (see codes below)
    DWORD SymbolType[MAXC];  // symbol types (see codes below)
    DWORD SizeofExtraInfo;   // Extra information following X,Y data (filled in by DPLOTLIB.DLL)
    char  Legend[MAXC+1][80];// Legend[0] is the caption for the legend.
                             // Legend[n] is the legend for the n'th curve.
    char  Label[MAXC][40];   // Strings displayed beside the last data point
                             //   in a curve.
    char  Title[3][80];      // Three title lines.
    char  XAxis[80];         // X Axis label.
    char  YAxis[80];         // Y Axis label.
} DPLOT;

// DataFormat graph-type and data organization codes
#define DATA_XYXY         0     // One or more sets of X,Y data
#define DATA_DXY          1     // One or more X,Y curves. Constant spacing in X and same number of points in all curves.
#define DATA_XYYY         2     // One or more X,Y curves. All curves have the same X values.
#define DATA_3D           3     // Z values on a rectangular grid
#define DATA_3DR          4     // Random X,Y,Z values
#define DATA_IMAGE        5     // Used only by DPlot - there's no way to SEND DPlot an image
#define DATA_1D           6     // One or more groups of Y values.
#define DATA_3DS          7     // 3D scatter plot

// Scale codes:
#define SCALE_LINEARX_LINEARY     1
#define SCALE_LINEARX_LOGY        2
#define SCALE_LOGX_LINEARY        3
#define SCALE_LOGX_LOGY           4
#define SCALE_TRIPARTITE          5
#define SCALE_LINEARX_PROBABILITY 6
#define SCALE_GRAINSIZE_DIST      7
#define SCALE_POLAR               8
#define SCALE_BARCHART            9
#define SCALE_LOGX_PROBABILITY   10
#define SCALE_PROBX_LINEARY      11
#define SCALE_PROBX_LOGY         12
#define SCALE_PROBX_PROBY        13
#define SCALE_TRIANGLE_PLOT      14
#define SCALE_N185               15

// Unit-specific scaling codes ... combine with above values using OR operator
#define UNITS_DEFAULT                   0
#define UNITS_TRIPARTITE_INCHES      UNITS_DEFAULT   // Velocity (Y) in inches/sec
#define UNITS_TRIPARTITE_FEET        0x00000100L     //                 feet/sec
#define UNITS_TRIPARTITE_MILLIMETERS 0x00000200L     //                 mm/sec
#define UNITS_TRIPARTITE_CENTIMETERS 0x00000300L     //                 cm/sec
#define UNITS_TRIPARTITE_METERS      0x00000400L     //                 meters/sec
#define UNITS_GRAINSIZE_MILLIMETERS  UNITS_DEFAULT   // Grain sizes (X) in mm
#define UNITS_GRAINSIZE_INCHES       0x00000100L     //                    inches
#define UNITS_POLAR_RADIANS          UNITS_DEFAULT   // Rotation (X) in radians
#define UNITS_POLAR_DEGREES          0x00000100L     //                 degrees
#define UNITS_USERDEFINED            0x00007F00L

// Line styles:
#define LINESTYLE_NONE        0
#define LINESTYLE_SOLID       1
#define LINESTYLE_LONGDASH    2
#define LINESTYLE_DOTTED      3
#define LINESTYLE_DASHDOT     4
#define LINESTYLE_MEDDASH     5
#define LINESTYLE_DASHDOTDOT  6
#define LINESTYLE_DASHDOTDOTDOT 7

// Symbol styles (search DPLOT.HLP for "SymbolType" for other symbol types)
#define SYMBOLSTYLE_NONE         0
#define SYMBOLSTYLE_DOT          1
#define SYMBOLSTYLE_CROSS        2
#define SYMBOLSTYLE_ASTERISK     3
#define SYMBOLSTYLE_X            4
#define SYMBOLSTYLE_SQUARE       5
#define SYMBOLSTYLE_DIAMOND      6
#define SYMBOLSTYLE_TRIANGLE     7
#define SYMBOLSTYLE_OCTAGON      8
#define SYMBOLSTYLE_ITRIANGLE    9
#define SYMBOLSTYLE_HEXAGON     10
#define SYMBOLSTYLE_PENTAGON    11
#define SYMBOLSTYLE_STAR        12
#define SYMBOLSTYLE_FILL        0x00000100L		// May be combined with styles above

 

 
Previous Home Next DPlot Home