home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l196 / 3.ddi / CHRTB.BI$ / CHRTB.bin
Encoding:
Text File  |  1990-06-24  |  8.2 KB  |  170 lines

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