home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l391_1 / 2.ddi / CHART.BI$ / CHART.bin
Encoding:
Text File  |  1992-08-19  |  7.9 KB  |  166 lines

  1. ' Include file for the Presentation Graphics ToolKit charting routines.
  2. '
  3. ' This file should be included in any application
  4. ' using the Presentation Graphics charting routines.
  5. ' It contains declarations for all of the
  6. ' user-accessible routines as well as type definitions
  7. ' for the ChartEnvironment datatype used by most
  8. ' of the routines.  Also included are constant
  9. ' definitions for some of the parameters that must be
  10. ' specified when using the charting routines.
  11. '
  12. ' Copyright (C) 1982-1992 Microsoft Corporation
  13. '
  14.  
  15. TYPE TitleType
  16.    Title        AS STRING * 70      ' Title text
  17.    TitleFont    AS INTEGER          ' Font for title text
  18.    TitleColor   AS INTEGER          ' Color of title
  19.    Justify      AS INTEGER          ' 1=Left, 2=Center, 3=Right
  20. END TYPE
  21.  
  22. TYPE AxisType
  23.    Grid         AS INTEGER          ' 0=No, 1=Yes
  24.    GridStyle    AS INTEGER          ' Style number for grid lines
  25.    AxisTitle    AS TitleType        ' Axis title
  26.    AxisColor    AS INTEGER          ' Color of axis
  27.    Labeled      AS INTEGER          ' 0=No tic marks, etc, 1=Tics, etc
  28.    RangeType    AS INTEGER          ' 1=Linear, 2=Log
  29.    LogBase      AS SINGLE           ' Base for log axis
  30.    AutoScale    AS INTEGER          ' 0=Manual, 1=Auto scale
  31.    ScaleMin     AS SINGLE           ' Minimum scale value
  32.    ScaleMax     AS SINGLE           ' Maximum scale value
  33.    ScaleFactor  AS SINGLE           ' Factor for scaling values on axis
  34.    ScaleTitle   AS TitleType        ' Title for scale factor
  35.    TicFont      AS INTEGER          ' Font for tic labels
  36.    TicInterval  AS SINGLE           ' Distance between tics in world coordinates
  37.    TicFormat    AS INTEGER          ' 1=Normal, 2=Exponential format labels
  38.    TicDecimals  AS INTEGER          ' Number of decimals in value label
  39. END TYPE
  40.  
  41. TYPE RegionType
  42.    X1           AS INTEGER          ' Left side of window (in pixels)
  43.    Y1           AS INTEGER          ' Top of window (in pixels)
  44.    X2           AS INTEGER          ' Right side of window (in pixels)
  45.    Y2           AS INTEGER          ' Bottom of window (in pixels)
  46.    Background   AS INTEGER          ' Background color
  47.    Border       AS INTEGER          ' 0=No border, 1=Border
  48.    BorderStyle  AS INTEGER          ' Style number for border LINE
  49.    BorderColor  AS INTEGER          ' Color to draw border in
  50. END TYPE
  51.  
  52. TYPE LegendType
  53.    Legend       AS INTEGER          ' 0=No legend, 1=Legend
  54.    Place        AS INTEGER          ' 1=Overlay, 2=Bottom, 3=Right
  55.    TextColor    AS INTEGER          ' Color of text in legend
  56.    TextFont     AS INTEGER          ' Font for legend text
  57.    AutoSize     AS INTEGER          ' 0=Manual, 1=Auto
  58.    LegendWindow AS RegionType       ' Legend window specification
  59. END TYPE
  60.  
  61. TYPE ChartEnvironment
  62.    ChartType    AS INTEGER          ' 1=Bar, 2=Column, 3=Line, 4=Scatter, 5=Pie
  63.    ChartStyle   AS INTEGER          ' Depends on type
  64.    DataFont     AS INTEGER          ' Font to use for plot characters
  65.    ChartWindow  AS RegionType       ' Overall chart window
  66.    DataWindow   AS RegionType       ' Data portion of chart
  67.    MainTitle    AS TitleType        ' Main title options
  68.    SubTitle     AS TitleType        ' Second line title options
  69.    XAxis        AS AxisType         ' X-axis options
  70.    YAxis        AS AxisType         ' Y-axis options
  71.    Legend       AS LegendType       ' Legend options
  72. END TYPE
  73.  
  74.  
  75. DECLARE SUB DefaultChart (Env AS ChartEnvironment, ChartType AS INTEGER, ChartStyle AS INTEGER)
  76.  
  77. DECLARE SUB AnalyzeChart (Env AS ChartEnvironment, Cat$(), Value() AS SINGLE, N AS INTEGER)
  78. DECLARE SUB AnalyzeChartMS (Env AS ChartEnvironment, Cat$(), Value() AS SINGLE, N AS INTEGER, First AS INTEGER, Last AS INTEGER, SeriesLabel$())
  79. DECLARE SUB AnalyzePie (Env AS ChartEnvironment, Cat$(), Value() AS SINGLE, Expl() AS INTEGER, N AS INTEGER)
  80. DECLARE SUB AnalyzeScatter (Env AS ChartEnvironment, ValX() AS SINGLE, ValY() AS SINGLE, N AS INTEGER)
  81. DECLARE SUB AnalyzeScatterMS (Env AS ChartEnvironment, ValX() AS SINGLE, ValY() AS SINGLE, N AS INTEGER, First AS INTEGER, Last AS INTEGER, SeriesLabel$())
  82.  
  83. DECLARE SUB Chart (Env AS ChartEnvironment, Cat$(), Value() AS SINGLE, N AS INTEGER)
  84. DECLARE SUB ChartMS (Env AS ChartEnvironment, Cat$(), Value() AS SINGLE, N AS INTEGER, First AS INTEGER, Last AS INTEGER, SeriesLabel$())
  85. DECLARE SUB ChartScatter (Env AS ChartEnvironment, ValX() AS SINGLE, ValY() AS SINGLE, N AS INTEGER)
  86. DECLARE SUB ChartScatterMS (Env AS ChartEnvironment, ValX() AS SINGLE, ValY() AS SINGLE, N AS INTEGER, First AS INTEGER, Last AS INTEGER, SeriesLabel$())
  87. DECLARE SUB ChartPie (Env AS ChartEnvironment, Cat$(), Value() AS SINGLE, Expl() AS INTEGER, N AS INTEGER)
  88.  
  89.  
  90. '-- Text routines:
  91. DECLARE SUB DefaultFont (SEG Segment%, SEG Offset%)
  92. DECLARE SUB LabelChartH (Env AS ChartEnvironment, X AS INTEGER, Y AS INTEGER, Font AS INTEGER, TxtColor AS INTEGER, TxtString$)
  93. DECLARE SUB LabelChartV (Env AS ChartEnvironment, X AS INTEGER, Y AS INTEGER, Font AS INTEGER, TxtColor AS INTEGER, TxtString$)
  94.                                      
  95. '-- Screen-mode routines:
  96. DECLARE SUB ChartScreen (N AS INTEGER)
  97.  
  98.  
  99. '-- Palette routines:
  100. DECLARE SUB GetPaletteDef (PaletteC() AS INTEGER, PaletteS() AS INTEGER, PaletteP$(), PaletteCh() AS INTEGER, PaletteB() AS INTEGER)
  101. DECLARE SUB SetPaletteDef (PaletteC() AS INTEGER, PaletteS() AS INTEGER, PaletteP$(), PaletteCh() AS INTEGER, PaletteB() AS INTEGER)
  102. DECLARE SUB ResetPaletteDef ()
  103. DECLARE FUNCTION GetPattern$ (Bits%, PatternNum%)
  104. DECLARE FUNCTION MakeChartPattern$ (RefPattern$, FG AS INTEGER, BG AS INTEGER)
  105.  
  106. '-- COMMON declaration for the error variable:
  107. COMMON SHARED /ChartLib/ ChartErr AS INTEGER
  108.  
  109.  
  110. '-- Constant definitions for setting charting parameters:
  111. CONST cPalLen = 15                 ' Length of charting palette
  112.  
  113. CONST cMissingValue = -3.4E+38     ' Denotes "missing" value in data
  114.  
  115. CONST cNo = 0
  116. CONST cYes = NOT cNo
  117.  
  118. CONST cLeft = 1                    ' title placement
  119. CONST cCenter = 2
  120. CONST cRight = 3
  121.  
  122. CONST cCategory = 1                ' category axis
  123. CONST cValue = 2                   ' value axis
  124.  
  125. CONST cNormFormat = 1              ' tic labels in decimal format
  126. CONST cExpFormat = 2               ' tic labels in exp format
  127.  
  128. CONST cLinear = 1                  ' linear axis
  129. CONST cLog = 2                     ' log axis
  130.  
  131. CONST cOverlay = 1                 ' Legend.Place
  132. CONST cBottom = 2
  133.  
  134. CONST cBar = 1                     ' bar chart
  135. CONST cPlain = 1                   ' unstacked data
  136. CONST cStacked = 2                 ' stacked data
  137.  
  138. CONST cColumn = 2                  ' column chart
  139.  
  140. CONST cLine = 3                    ' line chart
  141. CONST cLines = 1                   ' Lines connecting points
  142. CONST cNoLines = 2                 ' No lines connecting points
  143.  
  144. CONST cScatter = 4                 ' scatter chart
  145.  
  146. CONST cPie = 5                     ' pie chart
  147. CONST cPercent = 1                 ' Displays slice percent
  148. CONST cNoPercent = 2               ' Does not display slice percent
  149.  
  150. ' Constant definitions for error messages (number greater than 100
  151. ' are "fatal" errors and will cause charting routines to exit):
  152. CONST cBadDataWindow = 105         ' DataWindow calculated too small
  153. CONST cBadLegendWindow = 110       ' LegendWindow coordinates invalid
  154. CONST cBadLogBase = 15             ' LogBase <= 0
  155. CONST cBadScaleFactor = 20         ' ScaleFactor = 0
  156. CONST cBadScreen = 25              ' Invalid screen mode
  157. CONST cBadStyle = 30               ' Invalid chart style
  158. CONST cBadType = 135               ' Invalid chart type
  159. CONST cTooFewSeries = 155          ' Too few series (First > Last)
  160. CONST cTooSmallN = 160             ' No data in series (N=0)
  161. CONST cBadPalette = 165            ' Palette not dimensioned correctly
  162. CONST cPalettesNotSet = 170        ' Palette not init'd (GetPaletteDef)
  163. CONST cNoFontSpace = 175           ' No room to load default font
  164. CONST cCLUnexpectedOff = 200       ' Added to ERR for unexpected error
  165.  
  166.