CapeSoft.Com
Clarion Accessories
Insight Graphing
Documentation
Technical Guide
CapeSoft Logo

CapeSoft Insight Graphing 1
Technical Guide Documentation

JumpStart FAQ History
Installed Version Latest Version

Insight Class Properties

General Properties

ActiveInvisibleByteUsually the graph does not load data or draw if it cannot be seen. However, if you need it to draw regardless (typically so you can save it to a file), then set this property to 1.
BackgroundColorLongThe color to use as the wallpaper for the graph. Defaults to COLOR:Silver. This property is ignored if the BlackAndWhite property is set.
BackgroundShadeColorString(255)If this is set to a value >= 0, the background is shaded from BackgroundColor on the left to BackgroundShadeColor on the right. This property is ignored if the BlackAndWhite property is set.
BackgroundPictureLongA BMP file to use as the wallpaper for the graph. This property is ignored if the BlackAndWhite property is set.
BorderColorLongThe color of the border around the graph. Defaults to Color:Black.
ControlLongThe bounding control (graph region) )equate. Charts will be drawn within the bounds of this control.
DepthLongThe 3D depth of the chart (in 1/1000 inch).
MinPointWidthLongIf you have a large number of points on the graph, then naturally each point for the graph is very very small. This is not terribly useful, and can also make the graph look bad if each point is labeled. Setting this property allows you to set the minimum space (in pixels) occupied by each x-axis point. The graph workspace is adjusted accordingly - the region size will remain the same, but scrollbars may appear.
MouseMovePointValueFormatString(50)When your mouse moves over the graph, it is possible to display information relating to the data point your mouse is over somewhere on your window or on a tooltip. Use this property to specify the format in which the x-axis point value should be displayed.
PointsRealThe number of data points to plot. (This does not apply to Time charts). Note that this property is mostly for internal use.
PrintPortraitByteSet this to 1 if you want your graphs to print out in portrait style as opposed to landscape.
ReportBandLongThe target band on the report. This will be cleared after each call to Draw()
SavedGraphTypeLongThe graph type selected by the user the last time the application was closed.
SumariseAllSetsByteBy default this is set to 1. When the .GetPointSummary() method is called, all sets on the graph will be included in the summary. However, if this property is off, only the set over which the mouse is will be included.
SuppressBusyWindowsByteBy default, when the .PrintGraph() method is called, a small PRINTING message is displayed. If you want to suppress this message then set this property to 1.
TypeLongThe type of chart. Valid options are Insight:Line, Insight:Bar, Insight:Pie, Insight:Time, Insight:Gantt, Insight:Scatter and Insight:Pareto.
UnlockThreadForPrintLongUnlock the thread before printing starts. Basically, set this to 0 this if you are using FixIT and your other threads freeze when you print the graph. Init() sets this to 1.
WriteLogByteIf this is set to 1 then debugging information is written to the SysInternals DebugView program.
OpenText, CloseText, HighText,LowTextString(20)These properties contain the text, used when the tooltip for a Floating Bar or HiLo graph. They default to 'Open:', 'Close:', 'High:' and 'Low:' respectively.

Data Display Properties

AspectRatioRealFor 2D pie charts, if this is set to 1 the pie will always be circular (as opposed to elliptical).
AxisStyleByteFor "built-in" graph styles (for the axis). To set the style use the .SetStyle() method, with the style type set to Style:Axis.
BlackAndWhiteByteSet this property if the graph must only use black and white colors when drawing. Mostly used when printing to black and white printers.
DataStyleByteFor "built-in" graph styles (for the data). To set the style use the .SetStyle() method, with the style type set as Style:Data.
DrawMissingByteDraw through data points not supplied. (Line charts)
FillLongThe area below the data points will be filled (Line and Time charts)
FillToZeroLongThe area between the data points and the Zero mark will be filled (Line and Time charts)
FloatByteThis will allow floating bars based on the minimum values sent as data (Bar charts - see also .Data())
InnerRadiusLongThis is the value (as a percentage from 0 to 100) of the inside radius of the donut (pie charts only)
LineStyleLongThe style to use for drawing the Line. Valid options are Pen:Solid, Pen:Dash, Pen:Dot, Pen:DashDot and Pen:DashDotDot
LineWidthLongThe line width to use for data display. For example, for lines this will be the width of the line. For bars, this will be the width of the bar outline.
MaxPieRadiusLongSets the maximum radius of the Pie graph, in pixels. Useful on reports where you are trying to make several pie graphs all look the same size.
PatternByteSet this to Insight:Auto so that each set is assigned a default pattern. Set to Insight:None if the graph does not use patterns. If a pattern is specified here, all sets will be assigned this default pattern. For a list of patterns, see the Pattern entry of the Properties Tab in the Template Guide.
PieAngleRealSet this to the angle (in degrees) at which you would like the first pie slice to be drawn. 0 degrees is at 12 o-clock, and the angle increases in a clockwise direction from there.
PieLabelLineColorLongSet this to the color you would like the lines connecting each label to its respective pie slice to be.
PointWidthRealThe width the data point display should occupy of the allocated point display width.
ShapeByteDefaults to Insight:Auto. This property can be overridden at the Set level (see the Shape entry for the SetQ). Applies to Line and Scatter graphs. Set to Insight:None to suppress shapes on Line graphs.
SortSetLongThe data set to sort on for pareto charts.
SortStyleLongThe sort style. 0=none, 1 = high value on bottom and -1 = high value on top.
SquareWaveByteSet the default for the lines on the graph to be square waves.
StackedByteFor data value stacking (bar, line and pareto charts). Set to 1 or 0.
StackLinesByteWhen this is switched on, line graphs (and scatter graphs) will be stacked if the Stacked property above is switched on. Otherwise, line graphs wont be stacked. Default value is 1 (assigned by .Init()).
ZClusterByteZ-cluster bar charts. Bars at the same point will be stacked behind each other.

Data Label Properties

ColorDataLabelsByteColor the data labels the same as the set color.
DataFontString(50)The font to use for the data labels.
DataFontColorLongThe font color to use for the data labels.
DataFontHeightLongThe font height to use for the data labels.
DataFontStyleLongThe font style to use for the data labels.
DataLabelFormatString(50)The picture token to use to format data values for label display.
DataFontCharSetLongThe charset for the data label font.
DataFontAngleLongUse 0 or 90.
PieLabelLinesByteThe label for each slice of your pie can either be spread over one, two or three lines. If you want to override Insight's automatic choice, fill in either 1, 2 or 3 here. Note: Note that there are a maximum of 3 strings that can be displayed in the label - ShowDataLabelText, ShowDataLabelValue and ShowDataLabelPercent. Hence, if you for example choose PieLabelLines to be 3 and you only have 2 of the ShowDataLabelText, ShowDataLabelValue and ShowDataLabelPercent properties set to 1, there will be empty lines in the labels.
PiePercentFormatString(50)When ShowDataLabelsPercent is on, use this to specify the format you want the percentage value to be displayed in. When left empty, a default format is used.
ShortDataLabelsByteThe value to display is reduced to only 2 or 3 significant digits. For example, 123456 becomes 123K, 123456789 becomes 123M, 1234 becomes 1.2K, and so on. The unit (K) can also be turned on and off (see ShortDataLabelsUnit below).
ShortDataLabelsUnitByteIf set to 1 then the unit for the Data Label is displayed (see ShortDataLabels above).
ShowDataLabelsByteLabel the data points?
ShowDataLabelsEveryLongSet to n to show the data labels every n points.
ShowDataLabelsPercentByteShow data labels as a percentage of the total (pie chart only).
ShowDataLabelsValueByteShow data labels as a value (pie chart only).
ShowDataLabelsTextByteShow the name of the slice in the data label (pie chart only).

Grid Properties

AutoXGridTicksByteIf this is on, Insight will automatically calculate and use the optimum number of x-axis grid lines to use.
AutoYGridTicksByteIf this is on, Insight will automatically calculate and use the optimum number of y-axis grid lines to use.
BackBorderByteDraw a border around the back wall of the chart (useful for 2D charts only).
BackFillColorLongThe fill color for the chart background grid.
BackLineColorLongThe line color for the chart background grid.
BaseFillColorLongThe fill color for the chart base grid.
BaseLineColorLongThe line color for the chart base grid.
GridLineWidthLongThe linewidth to use to draw the grid frame.
MaxXGridTicksLongThe maximum number of x-axis grid lines to use.
MaxYGridTicksLongThe maximum number of y-axis grid lines to use.
RightBorderLongThe minimum gap to leave on the right hand side of the graph.
SideFillColorLongThe fill color for the chart side grid.
SideLineColorLongThe line color for the chart side grid.
XGridColorLongThe color of the x-axis grid lines.
XGridLineWidthLongThe thickness of the x-axis grid lines.
XGridStyleLongThe penstyle for the x-axis grid. Valid options are Pen:Solid, Pen:Dash, Pen:Dot, Pen:DashDot and Pen:DashDotDot.
XGridTicksLongThe number of x-axis grid lines to draw. Note that if AutoXGridTicks is on, this value will be ignored. Note: The x-axis (the line with the x-axis labels) is not counted towards the quantity of grid lines.
YGridColorLongThe color of the y-axis grid lines.
YGridLineWidthLongThe thickness of the y-axis grid lines.
YGridStyleLongThe penstyle for the y-axis grid. Valid options are Pen:Solid, Pen:Dash, Pen:Dot, Pen:DashDot and Pen:DashDotDot.
YGridTicksLongThe number of y-axis grid lines to draw. Note: The y-axis (the line with the y-axis labels) is not counted towards the quantity of grid lines.

Legend & Header Properties

HeaderFontString(50)The font to use for the header text.
HeaderFontColorLongThe font color to use for the header text.
HeaderFontHeightLongThe font height to use for the header text.
HeaderFontStyleLongThe font style to use for the header text.
HeaderFontCharsetLongThe font charset to use for the header text.
HeaderNameString(255)The header text.
LegendFontString(50)The font to use for the legend text.
LegendFontColorLongThe font color to use for the legend text.
LegendFontHeightLongThe font height to use for the legend text.
LegendFontStyleLongThe font style to use for the legend text.
LegendFontCharsetLongThe font charset to use for the legend text.
LegendAngleLongIf this is set to 0 then text is written horizontally, if it's set to 90 then the text is written vertically.
LegendStackedLongIf this is set to 1 then the legends are aligned on on top of one another, and if it is set to 0 then the legends are inline (i.e. side by side).
LegendPositionLongThe position of the legend. Valid options are 1 to 9 where 8=top, 2=bottom, 4=left, 6=right, and so on (look at the keypad).

Tip: The following combinations are NOT supported:
  • Position Right (6) or Left (4) with LegendStacked = 0 and LegendAngle = 0
  • Position Top (8) or Bottom (2) with LegendStacked = 0 and LegendAngle = 90
Tip: The text for the Legend is set using the .SetSetDescription() method.
LegendTextLongUsed in Pie charts. If ticked then the name of the point will appear in the legend.
LegendValueLongUsed in Pie charts. If ticked then the value of the point will appear in the legend.
LegendPercentLongUsed in Pie charts. If ticked then the percent of the point will appear in the legend.

X-Axis Properties

AutoXLabelsByteAutomatically generate labels for the x-axis.
DisplayFromRealThe first x-axis point to display the data from. Usually, insight calculates this point automatically from the data it needs to graph. Use this property to override the calculated value (all you need to do is set it before the call to .Draw()).
DisplayFromTimeRealThe first y-axis point to display the date/time from (gantt and time charts only) e.g. today() + (clock() / 8640000). Usually, insight calculates this point automatically from the data it needs to graph. Use this property to override the calculated value (all you need to do is set it before the call to .Draw()).
DisplayToRealThe last x-axis point to display the data to. Usually, insight calculates this point automatically from the data it needs to graph. Use this property to override the calculated value (all you need to do is set it before the call to .Draw()).
DisplayToTimeRealThe last y-axis point to display the date/time to (gantt and time charts only) e.g. today() + (clock() / 8640000). Usually, insight calculates this point automatically from the data it needs to graph. Use this property to override the calculated value (all you need to do is set it before the call to .Draw()).
DisplayOnXByteWhat to display on the x-axis.  0 = don't display, 1 = display PointNumber and 2 = display PointName.
LabelsTimeFormatString(50)The format for the time graph's x-axis labels. Of the form @d5+@t1 or @t4+@d3.
LineFromZeroLongFor Line graphs, start the x-axis at 0 instead of at 1.
ShowXLabelsLongDisplay x-axis labels (or not).
ShowXLabelsCountLongShow this many x-axis labels. Insight will try its best to display this number of points, but you may find that it will round this number up to ensure that the x-axis labels are evenly spread.
ShowXLabelsEveryLongShow an x-axis label every n points.
SpreadXLabelsBytespreads the x-axis labels equally across the X-Axis. Useful for graphs that have an uneven distribution of Point Numbers.
XAxisLabelsPositionByte0 is "normal" (i.e. bottom or left) - 1 is "other" (i.e. top or right). Note that the x-axis of a Pareto and Gantt graph is vertical.
XAxisLabelsJustifyByte0 = Right, 1 = Left and 2 = Center.
XAxisNameString(255)The x-axis name text.
XFontString(50)The font to use for the x-axis labels.
XFontColorLongThe font color to use for the x-axis labels.
XFontHeightLongThe font height to use for the x-axis labels.
XFontStyleLongThe font style to use for the x-axis labels.
XFontCharSetLongThe font charset to use for the x-axis labels.
XFontAngleLongThe font angle to use for the x-axis labels. 0 or 90.
XNameFontString(50)The font to use for the x-axis name.
XNameFontColorLongThe font color to use for the x-axis name.
XNameFontHeightLongThe font height to use for the x-axis name.
XNameFontStyleLongThe font style to use for the x-axis name.
XNameFontCharSetLongThe font charset to use for the x-axis name.

Y-Axis Properties

AutoScaleByteAutomatically calculate the best y-axis display range. This is a composite number (via addition) made up of Scale:None and Scale:Low + Scale:High + Scale:Zero.
If Scale:Low or Scale:High is omitted, then the value in YAxisMin and/or YAxisMax will be used. If Scale:Zero is used, then the scale will be adjusted to include zero. To disable auto scaling, set this property to Scale:None.
PercentSetNumLongIf you want the data to be displayed as percentage values on the y-axis and you want a set's value at each x-axis point to be used as the total for calculating those percentages, set this to the number of that set . If you don't want this set to be visible (typically you wouldn't, as it will be 100% at each x-axis point), just make it invisible.
SeparateYAxisByteUse separate y-axis values for each data set.
ShowYLabelsByteLabel the y-axis (or not).
ShortYAxisLabelsByteThe value to display is reduced to only 2 or 3 significant digits. For example, 123456 becomes 123K, 123456789 becomes 123M, 1234 becomes 1.2K, and so on. The unit (K) can also be turned on and off (see ShortYAxisLabelsUnit below).
ShortYAxisLabelsUnitByteAdd the unit (K,M) to the short label (see ShortYAxisLabels above).
YAxisLabelsPositionByteSet to 0 for left and 1 for Right. For Pareto and Gantt graphs, set this to 0 for top and 1 for bottom.
YAxisLabelsJustifyByteSet to 0 for Right, 1 for Left, or 2 for Center justify.
YAxisMaxRealThe y-axis maximum value (when SeparateYAxis = 0 and AutoScale = Scale:None).
YAxisMinRealThe y-axis minimum value (when SeparateYAxis = 0 and AutoScale = Scale:None).
YAxisNameString(255)The y-axis label text.
YFontString(50)The font to use for the y-axis labels.
YFontColorLongThe font color to use for the y-axis labels.
YFontHeightLongThe font height to use for the y-axis labels.
YFontStyleLongThe font style to use for the y-axis labels.
YFontCharSetLongThe font charset to use for the y-axis labels.
YFontAngleLongUse 90 to draw label text vertically, 0 for horizontal.
YFormatString(50)The picture token to use for format y-axis values for label display.
YIgnoreInvisibleSetsByteIgnore invisible sets when auto-scaling the y-axis.
YNameFontString(50)The font to use for the y-axis name.
YNameFontHeightLongThe font height to use for the y-axis name.
YNameFontStyleLongThe font style to use for the y-axis name.
YNameFontCharsetLongThe font charset to use for the y-axis name.
YNameAngleLongUse 90 to draw the name vertically, 0 for horizontal.
YNameFontColorLongThe font color to use for the y-axis name.

Shading Properties

AutoShadeByteIf set to 1, shading will be used on displays with more than 256 colors.
LongShadeByteIf set to 1, shading will be done relative to the axis, not to the data point value.
RightShadeByteIf set to 1, Insight will shade from left to right.
ShadeBackByteIf set to 1, the chart background grid will be shaded.
TopShadeByteIf set to 1, Insight will shade from top to bottom.

Zooming Properties

PaperZoomLongUse this to increase the resolution at which the graph prints on paper. This is set to 4 by default, which means that the resolution on paper will be four times as high as it is displayed on screen.
ShowFromPointRealData point to show from (non-Time charts). Mostly for internal use (see .Zoom()).
ShowFromPointTimeRealTime point to show from (Time charts). Mostly for internal use (see .Zoom()).
ShowToPointRealData point to show to (non-Time charts). Mostly for internal use (see .Zoom()).
ShowToPointTimeRealTime point to show to (Time charts). Mostly for internal use (see .Zoom()).
WorkSpaceWidthLongThe graph's width and height defaults to the control size on the window. However, since Clarion supports scroll bars on a control, there may be cases when you want the graph to be bigger than the control.  In this case, somewhere after the call to the .Init method, set the WorkSpaceWidth and WorkSpaceHeight properties. Scroll bars will be automatically added but OUTSIDE the space you've allocated to the control. So if you intend to have scrollbars, make sure you have sufficient space for them.
WorkSpaceHeightLongSee WorkSpaceWidth above.
ZoomLongPercentage to zoom in and out of of full point range. Mostly for internal use (see .Zoom()).
ZoomPointRealThe x-axis point which is being zoomed in to. Mostly for internal use (see .Zoom()).

Set Properties

Each data set has a number of properties that affect just this set. Although these properties can be read and written directly, where a method is supplied it is recommended that it be used to set the property.

Some of the properties override Graph Level properties, and some of the properties in turn can be overridden at the Data Level.

Use the .GetSet() method to get the correct queue entry for the set you want to edit. For example:

If ThisGraph.GetSet(n)
  ThisGraph.SetQ.
Property = x
  Put( ThisGraph.SetQ)
End

where n is the set number and x is the value you want to set the property to.

SetLongThe set number. Ideally starts with 1 for the first set, and goes up by 1 for each set (however, random numbers may also be used). Each set has a unique number. You can use the .AddSetQ() method to add a new set. You can use the .GetSet() method to load a set record. Notice that a pie graph will only ever have one set, and that this set number should always be set to 1.
DataLabelFormatString(50)A picture format used when writing the data labels for this set, e.g. @n12.2. If this is left blank, the DataLabelFormat will be used.
LabelDataStartPositionLongSetting this to n will cause the data labeling for this set to only start at the n'th x-axis point.
NoDataLabelsByteSet to True or False. Allows you to suppress the data labels for this set.
NoYAxisLabelsByteSet to True or False. Allows you to suppress the y-axis labels for this set (if SeperateYAxis is on). Typically used when another set has the same labels.
SetDescriptionString(100)The description of the set. This is used when setting the legend text and the point summary information. See .SetSetDescription().
ShortYAxisLabelsByteSet to True or False. See the entry with the same name under Y-Axis Properties (only useful if SeperateYAxis is on).
ShortYAxisLabelsUnitByteSet to True or False. See the entry with the same name under Y-Axis Properties (only useful if SeperateYAxis is on).
YAxisFormatString(50)A picture format used when writing the Y-Axis labels for this set. e.g. @n2.2

The following properties override the ones set at Graph Level.
AutoScaleByteThis is a composite number (via addition) made up of Scale:None and Scale:Low + Scale:High + Scale:Zero. See the entry with the same name under Y-Axis Properties (only useful if SeperateYAxis is on).
TypeLongAllows you to change the graph type of this set so that you can, for example, include a Line in a Bar chart. See .SetSetType()
FillLongApplies only to Line graphs. If set to 1 then the area under the graph will be "filled". If set to -1 then the default for the graph is used.
FillToZeroLongApplies only to Line graphs. If set to 1 then the area between the graph and the Zero mark (on the y-axis) will be filled. If set to -1 then the default for the graph is used.
MouseMoveFormatByteSpecifies the format the y-axis values for this set in the mouse-over information should be displayed in.
PointsLongLimits the set to the first n points (i.e. only the first n points of the set will be plotted on the graph). e.g. Useful for graphing the "top ten".
SquareWaveByteApplies only to Line graphs. If set to , the line will be drawn in a square format. If set to -1 then the default for the graph is used.
YAxisMaxRealSee the entry with the same name under Y-Axis Properties (only useful if SeperateYAxis is on).
YAxisMinRealSee the entry with the same name under Y-Axis Properties (only useful if SeperateYAxis is on).
YAxisStepRealSee the entry with the same name under Y-Axis Properties (only useful if SeperateYAxis is on).

The following properties override the graph level, and can be overridden at the data level.
PenColorLongThe pen color used for drawing this set. See .SetSetColors().
FillColorLongThe fill color used for drawing this set. See SetSetColors().
ShadeColorLongThe shade color used for drawing this set. See SetSetColors().
ShadowColorLongThe shadow color used for drawing this set. See SetSetColors().
IntensityLongThe brightness of the light source on your objects. Should have a value between 1 and 100. Make sure Autoshading is on. See SetSetColors().
LineStyleLongSet the style of the line used when drawing this set. Valid options are Pen:Solid, Pen:Dash, Pen:Dot, Pen:DashDot,and Pen:DashDotDot.
LineWidthLongSets the line width used when drawing this set.
PointWidthRealSpecifies the width of the bar in proportion to the space between bars at a given x-axis point. Is a percentage where 100 means bars touch, and 50 means that there is 1 bar with between bars.
PatternByteSets the pattern for this particular set. Use Insight:Auto to use the default pattern for this set.
ShapeByteSets the Shape for this set. Applies to Line and Scatter graphs. Use Insight:Auto to use the default shape for this set. Other valid options are Insight:None, Insight:Square, Insight:Circle, Insight:Triangle, Insight:Diamond.
VisibleByteSet to True or False. Default is True. If set to false then this set is ignored when drawing the graph. Useful when you want to offer the user the ability to turn sets on and off at runtime.

Data Properties

The data that Insight actually graphs is stored in the DataQ property. This is a Queue with the following fields. Accessing the Data Queue is not usually done directly, but nothing stops you. The usual method for adding items to the DataQ is the .Data() method.
SetLongThe set number of the set that the data point belongs to.
CountLongThis is an internal property that is set by .ResetQueue(). It holds the number of child records for this data point.
PointRealThe point number for this data point. For normal graphs this is an incrementing integer, usually starting at 1. For time graphs it is a real with the format date + time, e.g. dataq.point = Date + (Time / 8640000).
ValueMinRealFor floating bars, this is the y-axis value for the bottom of the bar.
ValueMaxRealThis is the data value (where the point should be plotted on the y-axis).
ValueOpenRealFor Hi-Lo graphs, this is the opening value.
ValueCloseRealFor Hi-Lo graphs, this is the closing value.

The following properties override the ones at the Set Level.
PenColorLongThe pen color used for drawing this data point.
FillColorLongThe fill color used for drawing this data point.
ShadeColorLongThe shade color used for drawing this data point.
ShadowColorLongThe shadow color used for drawing this data point.
IntensityLongThe brightness of the light source on your objects. Should have a value between 1 and 100. Make sure Autoshading is on.
LineStyleLongSet the style of the line used when drawing this point. Valid options are Pen:Solid, Pen:Dash, Pen:Dot, Pen:DashDot, and Pen:DashDotDot.
LineWidthLongSets the width of the line used when drawing this point.
PatternByteSets the pattern for this particular point. Use Insight:Auto to use the default pattern for this set number.
ShapeByteSets the Shape for this point. Applies to Line and Scatter graphs. Use Insight:Auto to use the default shape for this point. Other valid options are Insight:None, Insight:Square, Insight:Circle, Insight:Triangle, Insight:Diamond.
VisibleByteSet to True or False. Default is True. If set to false then this data point is ignored when drawing the graph. Useful when you want to offer the user the ability to turn points on and off at runtime.

Label Properties

The details for each label on the x- and y-axis are stored in a queue called the labelq. Typically, you would want to leave this queue alone, unless you want certain labels on the x- or y-axis to stand out, for example, by editing the font. You would put your code to do this in the SetLabelFonts() procedure. Your code would look something like this:

loop counter = 1 to records(self.LabelQ)
  
get(self.LabelQ, counter)
   if
errorcode()
     cycle
   end

   self.LabelQ.FontName = ''
   self.LabelQ.FontSize = 0
   self.LabelQ.FontColor = -1
  
put(self.LabelQ)
end

loop counter = 1 to records(self.LabelQ)
   get(self.LabelQ, counter)
   if errorcode()
      cycle
   end
   if
self.LabelQ.Type = Label:XAxis
     self.LabelQ.FontName = 'Arial'
     self.LabelQ.FontSize = 14
     self.LabelQ.FontColor = COLOR:Green
     put(self.LabelQ)
   end
end


The properties of this queue are as follows:

TypeLongChoose between Label:XAxis and Label:YAxis. For pies, choose Label:Xaxis.
SetlongInternal use. No touching.
PointlongThe x-axis point number for which this is a label.
ValuerealThe y-axis point for which this is a label.
DisplayTextString(100)The text to display for the label.
DisplayText2String(100)In case of multi-lined labels (pie charts only), this would be line two of the label.
DisplayText3String(100)In case of multi-lined labels (pie charts only), this would be line three of the label.
OriginalTextString(100)Internal use. No touching.
Xlongx-coordinate of the label, in pixels. For internal use, really.
Ylongy-coordinate of the label, in pixels. For internal use, really.
WlongWidth of the label, in pixels. For internal use, really.
HlongHeight of the label, in pixels. For internal use, really.
StartAnglerealStart angle of the pie slice for which this is a label. For internal use, really.
EndAnglerealEnd angle of the pie slice for which this is a label. For internal use, really.
FontNameString(40)Name of the font to use for this label. Leave blank if no override desired.
FontSizelongSize of the font to use for this label. Leave at 0 if no override desired.
FontColorlongColor of the font to use for this label. Leave at -1 if no override desired.
FontCharSetlongCharset of the font to use for this label. Leave at 0 if no override desired.
FontStylelongStyle of the font to use for this label. Leave at 0 if no override desired.
XOffSetlongSet this to the number of pixels you want the label to be shifted horizontally from where Insight was going to draw it originally.
YOffSetlongSet this to the number of pixels you want the label to be shifted vertically from where Insight was going to draw it originally.

Insight Class Methods

General Methods

.AddSpecialAxis

.AddSpecialAxis (Type, Value, LabelText, Pencolor, Penwidth, PenStyle, LabelColor, <Set>, XOffSet, YOffSet, ORLabelText)

Allows you to add specific axis lines to the graph background.

Parameters

ParameterTypeDescription
TypeLongEither Label:XAxis or Label:Yaxis.
ValueRealAxis value of the line being drawn.
LabelTextStringLabel text of the line.
PenColorLong = -1 Color of the line. If omitted then the usual color for that axis is used.
PenWidthLong = -1 Width of the line. If omitted then the usual width for that axis is used.
PenStyleLong = -1 Style of the line. If omitted then the usual style for that axis is used. Valid options are Pen:Solid, Pen:Dash, Pen:Dot, Pen:DashDot, and Pen:DashDotDot.
LabelColorLong = -1 Color of the label text. If omitted then the usual color for that axis is used.
Set<Long>If not omitted, the special axis will be assigned to the specified set. If Separate Axies is ticked on, the special axis will be drawn relative to this set's y-axis.
XOffSetLong = 0Set this to the number of pixels you want the label to be shifted horizontally from where Insight was going to draw it originally.
YOffSetLong = 0 Set this to the number of pixels you want the label to be shifted vertically from where Insight was going to draw it originally.
ORLabelTextLong = 0 If you want Insight to draw the other labels even though this special label will draw straight over them, set this to 1
Returns

None

Example

Example
MyChart.AddSpecialAxis (Label:YAxis,300,'')
MyChart.AddSpecialAxis (Label:YAxis,300,'',Color:Blue)

.GetWindowsColors

.GetWindowsColors (iColor)

Fetch the Standard Windows Colors.

Parameter Type Description
iColor*iColorGroupType A group into which the fetched values are populated. See the Notes below.
Returns

None

Notes

The iColorGroupType has the following declaration:

iColorGroupType                Group, Type

Scrollbar                        Long
Background                       Long
ActiveCaption                    Long
InactiveCaption                  Long
Menu                             Long
Window                           Long
WindowFrame                      Long
MenuText                         Long
WindowText                       Long
CaptionText                      Long
ActiveBorder                     Long
InactiveBorder                   Long
AppWorkSpace                     Long
Highlight                        Long
HighlightText                    Long
BTNFace                          Long
BTNShadow                        Long
GrayText                         Long
BTNText                          Long
InactiveCaptionText              Long
BTNHighlight                     Long
                             
DKShadow3D                       Long
Light3D                          Long
InfoText                         Long
InfoBK                           Long
                      
HotLight                         Long
GradientActiveCaption            Long
GradientInactiveCaption          Long
                      
MenuHighlight                    Long
MenuBar                          Long
                   
Desktop                          Long
Face3D               
           Long
Shadow3D                 
       Long                
Highlight3D               
      Long
HiLight3D
                                 Long
BTNHiLight                          Long

Fetched                          Long

                               End

The last Fetched field can be used to make sure that .GetWindowsColors() is called only once in your application. It is set to 1 by .GetWindowsColors().
Example
Fetch the windows standard color and use them for set 1:

!DATA
iColor      Group(iColorGroupType)            
            End


  CODE
  ThisGraph1.GetWindowsColors(iColor)
    ThisGraph1.SetSetColors(1, Color:Black, iColor:BTNFace, Color:Black, Color:White)

.Init

.Init (Control, Type = 1, Points = 1), byte

Initialize the object for use.

Parameter Type Description
ControlLongThe bounding control (graph region) )for the chart.
TypeLong = 1 The type of chart.
PointsReal = 1 The number of data points.
Returns

True if successful, false if not.

Notes

The points parameter is not required for Time charts.
Example
Initialize the object for a Bar chart with 12 points to be draw in ?Region1.
Success# = MyChart.Init (?Region1, 12)

.Kill

.Kill

Clean up the object resources after use.

Parameters

None

Returns

None

Example
Example
Kill a previously used chart.
MyChart.Kill ()

.SetMouseMoveParameters

.SetMouseMoveParameters

.SetMouseMoveParameters (SumariseAllSets, MouseMovePointValueFormat)

Parameters

Parameter Type Description
SumariseAllSetsLongSets the SumariseAllSets property.
MousePointValueFormatStringSets the MouseMovePointValueFormat property.
Returns

None

Example
Example
MyChart.SetMouseMoveParameters(1, '@N12.2')

.ToClipBoard

.ToClipBoard ()

Copies the graph to the windows clipboard.

Parameters

None

Returns

None

Example
Example
Copy the graph to the windows clipboard:
MyChart.ToClipBoard()

.SwitchControls

.SwitchControls (pNewControl, pImageControl = 0)

Changes the (region) control the Insight object uses to draw a graph in.

Parameters
Parameter Type Description
pNewControlLongThe control which will contain the new image that the Insight object will create to draw the graph on.
pImageControlLong = 0 The image control on which the graph should be drawn. If omitted, a new image control will be created within the specified region.
Returns

None

Notes

Remember to call .Draw() for the graph to appear in its new location. The old graph image will remain.

Example

Example
Change the control the ThisGraph1 Insight object uses to draw the graph in:
ThisGraph1.SwitchControls(?Region2)
ThisGraph1.Draw()

.SetMirrorText

.SetMirrorText (pMirror)

Switches mirroring text on graph on or off.

Parameters

Parameter Type Description
pMirrorLongSet to 1 for mirroring text, 0 for not.

Returns

None

Notes

Remember to call .Draw() for changes to appear onscreen.

Example

Example
Switch text mirroring on:
ThisGraph1.SetMirrorText(1)
ThisGraph1.Draw()

Information Methods

.GetPoint

.GetPoint (Set, Point), byte

Calculates the chart point that the mouse vertical is at.

Parameters

Parameter Type Parameter
Set*LongThe set number where the mouse is. This value is filled in by the method.
Point*RealThe point number where the mouse is. This value is filled in by the method.
Returns

True if successful, False otherwise

Notes

A return value of 0 shows that the mouse is not pointing at a data item on the chart.
For time charts, the integer portion of the point value shows the date, and the decimal portion shows the time, as a proportion of one day.

Example

Example
To show where the mouse is pointing:

Set     Long
Point   Real

  CODE

  If MyChart.GetPoint(Set,Point)
    MouseAtDisplay =
'Mouse at point ' & Point
  Else
    MouseAtDisplay = 'Mouse not on chart.'
  End

  !for a time chart show where the mouse is pointing
 
If MyChart.GetPoint(Set,Point)
    MouseDate =
INT(Point)
    MouseTime = (Point - MouseDate) * (24*60*60*100)
    MouseAtDisplay =
FORMAT(MouseDate, @d6) & ' ' & FORMAT(MouseTime, @t1)
 
Else
    MouseAtDisplay = '
Mouse not on chart.'
 
End

.GetPointName

.GetPointName (Set = 0, Point = 0), string

Returns the point name for the supplied x-axis point.

Parameters
Parameter Type Description
SetLong=0The set number.
PointReal=0The point number.
Returns

The x-axis point name (label) for the point.

Notes

As the x-axis label is always stored with set 1, the actual value in the set parameter is largely irrelevant. It should typically be set to 1. If one of the Set or Point parameters is omitted or 0, a call to .GetPoint() will be made to determine the point that the mouse is at. This point's name will then be returned.

Example

Example
Get the label for the point that the mouse is at:
CurrentPointLabel = MyChart.GetPointName()

.GetPointValue

.GetPointValue (Set = 0, Point = 0, LookBack = 0, TreatLinesAsDiscrete = 0), real

Get the value for a point at the given set.

Parameters
Parameter Type Description
SetLong=0The set to get the value for.
PointReal=0The point at which to get the value for the given Set.
LookBackLong=0The direction in the data set to look for the closest value.
TreatLinesAsDiscreteByte=0 Instead of returning the mouse y-coordinate for a line or time graph (which are both assumed to be continuous), return a value only if one was supplied for the line at Point.
Returns

The value for the set at the point (or at the nearest point - see Notes below).

Notes

If the Point is omitted or 0, a call to .GetPoint() will be made, and this point will be used.

The Lookback parameter shows which way to look for the closest value where no value exists for the given Set at the supplied Point:


Example

Example
Show the value for sets 1 and 2 at the point where the mouse is and look for the next lowest point value when there is no value for that set at the mouse position:
Set1Value = MyChart.GetPointValue(1, ,-1)
Set2Value = MyChart.GetPointValue(2, ,-1)

.GetMousePos

.GetMousePos (MouseX, MouseY)

Get the mouse coordinates.

Parameters
Parameter Type Description
MouseX*LongThe x-axis point, in pixels. This value is filled in by the method.
MouseY*LongThe y-axis point, in pixels. This value is filled in by the method.
Returns

None

Example

Example
Get the mouse coordinates:
MyChart.GetMousePos(MouseX, MouseY)

.GetPointSummary

.GetPointSummary ( IPN, Separator)

Get a summary of the data point your mouse is at.

Parameters

Parameter Type Description
IPNLongInclude Point Name. Set to 1 to include the point name in the summary, or zero to leave it off.
SeparatorStringThe separator to use between listed sets.
Returns

A string containing a whole summary of the point under the mouse.

Notes

SumariseAllSets determines whether all sets are included in the summary, or only the set over which the mouse is currently hovering.
Only sets that have a Description set will be included in the tip.

Example

Example
Show the value for set 1 and 2 where the mouse is:
?ThisGraph1{prop:tip} = ThisGraph1.GetPointSummary(1,'<10>')

.GetSetDescription

.GetSetDescription (Set)

Get the set descriptor (used for legends and point summary)

Parameters
Parameter Type Description
SetLongThe set number to return the description for.
Returns

String - the set description.

Example

Example
Get setnumber 3's description:
Set3Descriptor = MyChart.GetSetDescription(3)

Data Methods

.AddItem

.AddItem (ID, Set, [<V | Q>] , Action, <FH>, <FL>, <FO>, <FC>, <PF>, <Point>, < PointName>)

This function allows you to add a whole stream of data to the graph. Typically this means adding a View, or Queue, but it can also be used to add individual memory variables. The Reset method calls .ResetQueue, which in turn is the animal that reads through the Views & Queues and adds the information to the actual graph. Thus if a View or Queue changes, then .Reset should be called (followed by .Draw so you can see the actual graph.)

Parameters
Parameter Type Description
IDLongThis assigns an ID to the view or Queue you are adding. Inside .ResetQueue(), various methods, such as .ValidateRecord(), .SetRecordHigh(), .SetRecordLow(), .SetRecordOpen(), .SetRecordClose(), .SetSetNumber(), . SetPointName() and .SetPointNumber() are called. Since all of these are designed to allow code to be embedded, it's useful to know which View or  Queue is being processed. Thus all of these methods pass this ID number through to you. The actual value of ID is not important, you can set it to any unique number you like. Note: When using AddItem() to add multiple sets from the same queue or file, the same ID number should be used for each of these method calls, because the data source is the same each time.
SetLongSets the set number for this group of data. If you wish the data to span multiple sets, then set this to 0 and add code to the .SetSetNumber() method. The .SetSetNumber() method will be called by .ResetQueue() for each item in the Queue or View if this parameter is set to 0.
V|Q<View / Queue>The View, or Queue, containing the data. Omitting this parameter implies the data is a simple memory variable.
Action<Long>One of Insight:CountRecord, Insight:SumField, Insight:AverageField or Insight:GraphField.  If you use Insight:SumField or Insight:AverageField, then a Parent Field (PF below) is required.
FH<?>A field to Graph. If this parameter is omitted then .SetRecordHigh() will be called by .ResetQueue() for each record. The actual effect of this value depends on the graph type. See the Notes below for details.
FL<?>A field to Graph. If this parameter is omitted then .SetRecordLow() will be called .ResetQueue() for each record. The actual effect of this value depends on the graph type. See the Notes below for details.
FO<?>A field to Graph. If this parameter is omitted then .SetRecordOpen() will be called .ResetQueue() for each record. The actual effect of this value depends on the graph type. See the Notes below for details.
FC<?>A field to Graph. If this parameter is omitted then .SetRecordClose() will be called .ResetQueue() for each record. The actual effect of this value depends on the graph type. See the Notes below for details.
PF<?>If you are using Insight:SumField or Insight:AverageField in the Action above, then you can enter a parent field here.  For example, if you were summing invoice line items, then the parent field would be the invoice number. If you want to use an expression for a parent field, then enter a variable here and set this variable in the .ValidateRecord() method to whatever expression you need. .ValidateRecord() is called by .ResetQueue().
Point<?>If the point number is stored in the View or Queue, then specify it here. If this is not entered then .SetPointNumber() will be called by .ResetQueue() for each record.
PointName<?>If the point name is stored in the View or Queue, then specify it here. If this is not entered then .SetPointName() will be called by .ResetQueue() for each record.
Returns

None

Notes
Graph Type FieldHigh FieldLow FieldOpen FieldClose
Bar / ParetoTop of the barBottom of the bar (if the bar is floating)Not usedNot used
Line / Pie / Time Graph pointNot usedNot usedNot used
GanttStart DateStart timeDuration daysDuration time
Hi-LoTop of the barBottom of the barOpening valueClosing value
Example
Example
Add a queue called PlottingQueue's data to the graph. Graph each field pq:value of the queue as a point on the graph, with the x-axis point numbers and names given by the fields pq:pointNumber and pq:pointName of the queue.

ThisGraph2.AddItem(1 , 1, PlottingQueue, Insight:GraphField, pq:value, , , , , pq:pointNumber, pq:pointName)

.AddSetQ

.AddSetQ (Set)

Initialize a new record in the SetQ Queue (add a new set).

Parameters

Parameter Type Description
SetLongThe set number for the new set
Returns

None

Notes

You do not usually need to call this method. It will be called automatically when required. However if you explicitly want to set properties for a given set, then you can call this first to create the entry in the SetQ.

Example

Example
Add a new set with setnumber 3.
ThisGraph2.AddSetQ(3)

.ClearData

.ClearData (Set = 0)

Clear data values from the chart to plot.

Parameters
Parameter Description Description
SetLong = 0The set who's data values to clear.
Returns

None

Notes

If set is omitted or 0 then all the sets' data values will be cleared.

Example
Example
Clear set 2's data values:
MyChart.ClearData(2)

Clear all data values:
MyChart.ClearData()

.ClearSetQ

.ClearSetQ ()

Clear all the sets from the SetQ.

Parameters

None

Returns

None

Notes

This method frees the entire SetQ. This means that all properties of all sets, such as the color settings, bar widths and data label formats will be deleted. Upon adding a new set, or re-adding an old set, all of these properties will have to be set again using the applicable methods. If a set should only be "deleted" temporarily, rather use the .SetSetVisible() method to make the set invisible.

Example

Example
Free the SetQ:
MyChart.ClearSetQ()

.Data

.Data (Set, Point, Value, LowValue, <ValueOpen>, <ValueClose>, <Count>, <Duration>, <LineStyle>, <LineWidth>) Send data values to the chart to plot (adds a data point to the DataQ).

Parameters
Parameter Type Description
SetLongThe set this data point belongs to. See the DataQ.
PointRealThe x-axis point for this data point. See the DataQ.
Value<Real>The value at this point (y-axis). See ValueMax in the DataQ.
LowValue<Real>The low value for this point. See the DataQ.
ValueOpen<Real>The opening value for this point. See the DataQ.
ValueClose<Real>The closing value for this point. See the DataQ.
Count<Long>The number of child records for this data point. See the DataQ.
Duration<Real>Not yet implemented.
LineStyle<Long>The line style for this point. See the DataQ.
LineWidth<Long>The line width for this point. See the DataQ.
Returns

None

Notes

The low value has implications depending on the chart type - see the DataQ. In all charts the LowValue can be used to force automatic scaling from the supplied value. For Time charts, see .DataTime().

Example

Example
Send a value of 77 for set 2, point 5:
MyChart.Data(2, 5, 77)

Send a value of 77 for set 2, point 5, and force the auto-scaling to run from -100:
MyChart.Data(2, 5, 77, -100)

Send floating bar values of 44 to 77 for set 2, point 5:
MyChart.Data(2, 5, 77, 44), or
MyChart.Data(2, 5, 44, 77)

.DeleteItem

.DeleteItem (ID)

Allows you to remove a data source added using the .AddItem() method.

Parameters
Parameter Type Description
IDLongThis is the ID number of the item, as used when .AddItem() was called.
Returns

None

Notes

This method allows you to remove queues and views from the graph that were previously added using the .AddItem() method. You do not typically need to call this method.

Example
Example
Remove the queue with ID number 5 from the data to plot on your graph:
MyChart.DeleteItem(5)

.DataTime

.DataTime (Set, Date, Time, <Value>)

Send data values to a Time chart to plot.

Parameters
Parameter Type Description
SetLongThe set this value belongs to.
DateLongThe date for the point.
TimeLongThe time for the point.
Value<Real>The (y-axis) value for this point.
Returns

None

Notes

This method calls the .Data() method. The point is calculated as Date + (Time / (24*60*60*100)). Thus, the internal call to .Data() would be (where 8640000 = (24*60*60*100) is one day in Clarion time):
MyChart.Data (Set, Date + (Time / 8640000), Value)

Example
Example
Send a value of 77 for set 2 at the current date and time:
MyChart.DataTime (2, TODAY(), CLOCK(), 77)

Thus, for this example, the internal call to .Data() would be:
MyChart.Data (2, TODAY() + (CLOCK() / 8640000), 77)

.Reset

.Reset (Force = 0)

Resets the data to be graphed.

Parameters
Parameter Type Description
ForceByte = 0 For embedding purposes. The internal workings of this method makes no use of this.
Returns

None

Notes

Calls .ClearLabelX(), .Resize() and .ResetQueue() in turn. It is usually followed by a call to the .Draw() method so that the changes are visible on the screen or report. Make use of the embed point before the parent call if you want to call this method yourself with a Force parameter value other than zero.

Example

Example
ThisGraph.Reset()
ThisGraph.Draw()

.ResetQueue

.ResetQueue (Set)

Loads the data out of the views and queues (specified by .AddItem()). If the data in the view or queue has changed, then this method should be called.

Parameters
Parameter Type Description
SetLongThe set to reload. If all sets should be reloaded then set this to 0.
Returns

None

Notes

This method is usually followed by a call to .Draw() so that the changes are visible on the graph.

Example
Example
ThisGraph.ResetQueue(2)
ThisGraph.Draw()

.ScaleYAxis

.ScaleYAxis

Calculates the scaling for the y-axis based on the Y-Axis Properties.

Parameters

None

Returns

None

Notes

This calculates the y-axis scaling based on the AutoScale and SeperateYAxis properties.
.Draw() calls this method.

Example
Example
ThisGraph.ScaleYAxis()

Label Methods

.AddDataLabel

.AddDataLabel (Set, Point, Label)

Allows you to explicitly set a data label. Usually the value of the data is used but there may be a case where you want to override that with a specific label.

Parameters
Parameter Type Description
SetLongThe data set the point belongs to.
PointRealThe data point for the data label.
LabelStringThe label.
Returns

None

Notes

Labels are cleared by calls to .Reset() and used by calls to .Draw(). So the best place to embed this code is in the Event:Accepted embed point for the Graph control before the generated code.

Example
Example
Label point 3 belonging to set 2 as 'Highest':
MyChart.LabelData (2, 3, 'Highest')

.AddXLabel

.AddXLabel (Point, Label, Overwrite = 1)

Sets the text for the specified x-axis label.

Parameters
Parameter Type Description
PointRealThe point for the x-axis label.
LabelStringThe label text.
OverwriteLong = 1 If set to 1, the label will be overwritten (if it exists) with the new label text. If set to 0, the existing label will remain unchanged.
Returns

None

Notes

The text is stored in the LabelQ.OriginalText property. The LabelQ.Type property is equal to 2 (Label:XAxis) as this is an x-axis label. See the Programmers Corner in the User Guide for more on the LabelQ property.

This method is called automatically by the .ResetQueue() method using the value supplied by the .SetPointName() method.

Example
Example
Label point 1 as 'Jan':
MyChart.AddXLabel (1, 'Jan')

.AddXLabels ()

.AddXLabels () [internal]

Ensures that each of the x-axis points has a label.

Parameters

None

Returns

None

Notes

Called internally by the .Draw() method. If the AutoXLabels property is set to true, this method makes sure that each x-axis point has an x-axis label. It calls .AddXLabel() for each point to actually add the label, with Overwrite set to 0.

Example
Example
MyChart.AddXLabels()

.AddYLabels

.AddYLabels () [internal]

Ensures that each of the y-axis points has a label.

Parameters

None

Returns

None

Notes

Called internally by the .Draw() method.

Example
Example
MyChart.AddYLabels()

.ClearLabelX

.ClearLabelX (Point = 0)

Clear an x-axis label.

Parameters
Parameter Type Description
PointReal = 0 The point for which to clear the x-label.
Returns

None

Notes

If omitted or 0, all x-axis labels will be cleared.

Example
Example
Clear x-axis label at point 1:
MyChart.ClearLabelX(1)

Clear all x-axis labels:
MyChart.ClearLabelX()

.ClearLabelY

.ClearLabelY () [internal]

Clear the y-axis labels from the LabelQ.

Parameters

None

Returns

None

Notes

Called internally by the .AddYLabels() method.

Example
Example
MyChart.ClearLabelY()

.ClearLabelData

.ClearLabelData (Set = 0, Point = 0)

Clear data label(s).

Parameters
Parameter Type Description
SetLong = 0 The set to clear the data labels for.
PointReal = 0 The point to clear the data label for.
Returns

None

Notes

If Set is omitted or 0, all sets' data-labels at that point will be cleared. If Point is omitted or 0, all points within that set's data-labels will be cleared.

Example
Example
Clear data labels for set 1 at point 3:
MyChart.ClearLabelData(1, 3)

Clear data labels for set 1:
MyChart.ClearLabelData(1)

Clear all data labels at point 3:
MyChart.ClearLabelData(, 3)

Clear all data labels:
MyChart.ClearLabelData()

.GetLabel

.GetLabel (Type, Set, Point), long

Get the data label for the specified set at the specified point.

Parameters
Parameter Type Description
TypeLongChoose one of Label:YAxis, Label:XAxis or Label:Data. Pie Chart labels are of type Label:Xaxis.
SetLongThe set the label belongs to. X-axis labels usually belong to set 1. Y-axis labels belong to set 1 unless SeperateYAxis is on.
PointRealThe point the label belongs to.
Returns

True if the fetch succeeded, False if not.

Example
Example
Get the data label for set 1 at point 3:
MyChart.GetLabel(Label:Data, 1, 3)

Low Level Drawing Methods

Note: Many of the low-level drawing commands take co-ordinates (x,y, width, height and so on.) You should, wherever possible, draw using relative co-ordinates, not fixed co-ordinates. If you draw with fixed co-ordinates, then the items will not scale well if the user chooses to print the graph (right-click print) or if the graph is rescaled on the window. By drawing with relative co-ordinates your drawing will scale better.

Display()

Display()

Call this after using the low level drawing methods to cause the drawing additions to display.

Parameters

None

Returns

None

Notes

If you use any of the Draw methods, and you fail to call this at the end, your drawing additions will not be displayed.

Example
Example
Draw a diagonal line through your chart, from top left to bottom right:
MyChart.SetPen(Color:Red, Pen:Solid, 1)
MyChart.DrawLine(MyChart.CX, MyChart.CY,MyChart.CW,MyChart.CH)
MyChart.Display()

DrawArc

DrawArc(X, Y, W, H, StartAngle, EndAngle, PenColor, FillColor = Color:None, ShadeColor = Color:White, Shade = 0, StartRadius = 0, EndRadius = 0, DropHeight = 0, DropColor = Color:None)

Draw an arc on the chart.

Parameters
Parameter Type Description
XLongX-coordinate of the box bounding the ellipse.
YLongY-coordinate of the box bounding the ellipse.
WLongWidth of the box bounding the ellipse.
HLongHeight of the box bounding the ellipse.
StartAngleRealIn 10ths of a degree (i.e. 3600 = 360 degrees).
EndAngleRealIn 10ths of a degree (i.e. 3600 = 360 degrees).
PenColorLongColor of the arc.
FillColorLong = Color:None Color to fill the area bounded by the arc with.
ShadeColorLong = Color:WhiteShade color for the filled area of the arc.
ShadeLong = 0 Percentage where shade highlights.
StartRadiusLong = 0 A percentage = i.e. 1 to 100.
EndRadiusLong = 0 A percentage = i.e. 1 to 100.
DropHeightLong = 0 3D height of the arc drop.
DropColorLong = Color:NoneColor of the 3D drop.
Returns

None

Notes

Basically draws Pie slices. Be sure to call .Display() to make your changes appear on the graph. The best place to call this method is in the .Draw() method after the parent call.

Example
Example
Draw an arc starting at the top left-hand corner of the graph region in red:
MyChart.DrawArc (1, 1, 100, 100, 900, 1800, Color:Red)
MyChart.Display()

DrawEllipse

DrawEllipse(X, Y, W, H, FillColor, Depth, DepthColor)

Draws an ellipse.

Parameters
Parameter Type Description
XLongX-coordinate of the box bounding the ellipse.
YLongY-coordinate of the box bounding the ellipse.
WLongWidth of the box bounding the ellipse.
HLongHeight of the box bounding the ellipse.
FillColorLongColor to fill the ellipse with.
Returns

None

Notes

Uses the current attributes set by .SetPen(). Be sure to call .Display() to make your changes appear on the graph. The best place to call this method is in the .Draw() method after the parent call.

Example
Example
Draw a red circle at (20, 20):
MyChart.SetPen(Color:Red, Pen:Solid, 1)
MyChart.DrawEllipse(20, 20, 10, 10, Color:Red)
MyChart.Display()

DrawLine

DrawLine(X, Y, W, H)

Draws a Line.

Parameters
Parameter Type Description
XLongX-coordinate of the starting point of the line, starting at the top left-hand corner.
YLongY-coordinate of the starting point of the line, starting at the top left-hand corner.
WLongHorizontal length of the line, going right from (x, y).
HLongVertical length of the line, going down from (x, y).
Returns

None

Notes

Same as Clarion Line command. Uses the current attributes set by .SetPen(). Be sure to call .Display() to make your changes appear on the graph. The best place to call this method is in the .Draw() method after the parent call.

Example
Example
Draw a line that is the top-left to bottom-right diagonal in the 100x100 square starting at (10, 10):
MyChart.SetPen(Color:Red, Pen:Solid, 2)
MyChart.DrawLine(10,10,100,100)
MyChart.Display()

DrawPixel

DrawPixel(X, Y)

Draws a single pixel.

Parameters
Parameter Type Description
XLongX-coordinate of the pixel.
YLongY-coordinate of the pixel.
Returns

None

Notes

Uses the current attributes set by .SetPen(). The last two parameters of .SetPen() are irrelevant in this case. Be sure to call .Display() to make your changes appear on the graph. The best place to call this method is in the .Draw() method after the parent call.

Example
Example
Draw a red pixel at (10, 15):
MyChart.SetPen(Color:Red, Pen:Solid, 2)
MyChart.DrawPixel(10, 15)
MyChart.Display()

DrawPolygon

DrawPolygon(Array, Color = Color:None, Shade = 0, ShadeColor = Color:White, Depth = 0, Pattern = 0, Horisontal = 0)

Draws a polygon.

Parameters
Parameter Type Description
Array *signed[]An array of coordinates, [x_1, y_1, x_2, y_2, x_3, y_3 ...], containing the points of the polygon. Note that this array should have size 8 (ie. your polygon can only have four verticies). Be sure to enter the vertices in a clockwise direction.
Color Long = Color:None The color to fill the polygon with.
Shade Long = 0 Shade type. Shade < 0 indicates top shade, otherwise the polygon will be right-shaded. See also the Shading Properties, which also affect the shading of the polygon.
ShadeColor Long = Color:WhiteThe shade color for the polygon.
DepthLong = 0 If Depth > 0 and AutoShade is on, Insight will draw a cylinder. The Depth refers to the height of the ellipse at the end of the cylinder.
PatternLong = 0 If you want the polygon to be filled with a pattern, fill in the equate here. See the Pattern property on the Properties Tab for a list.
HorizontalLong = 0 Set to 1 if you want the bar to be drawn horizontally.
Returns

None

Notes

Uses the current attributes set by .SetPen(). This method was originally created to draw bars for Bar graphs. Hence you will notice that, for the most, this method will only take notice of the first 8 entries in your array. You may find that using this function to draw shapes other than rectangular ones is going to be difficult. Settings such as the Shading Properties will affect how the graph is drawn. Be sure to call .Display() to make your changes appear on the graph. The best place to call this method is in the .Draw() method after the parent call.

Example
Example
Draw a red right-shaded square on the graph region, with bottom left-hand corner at (10, 10):
a[1] = 10; a[2] = 10; a[3] = 10; a[4] = 20; a[5] = 20; a[6] = 20; a[7] = 20; a[8]= 10
MyChart.SetPen(Color:Red, Pen:Solid, 2)
MyChart.DrawPolygon(a, Color:Red, 100, Color:White)
MyChart.Display()

Show(X, Y, Text, Rotation)

Show(X, Y, Text, Rotation)

Displays text on the graph region.

Parameters
Parameter Type Description
XLongX-coordinate of the bottom left-hand corner of the text.
YLongY-coordinate of the bottom left-hand corner of the text.
TextLongText you want displayed.
RotationLong0 (horizontal) or 90 (vertical)
Returns

None

Notes

Similar to the Clarion Show command (but with an extra rotation parameter). Uses the current attributes set by .SetFont(). Be sure to call .Display() to make your changes appear on the graph. The best place to call this method is in the .Draw() method after the parent call.

Example
Example

Display the text 'Looky here' starting at (10, 10) on the graph region:

MyChart.SetFont('Arial', 12, Font:Regular, Color:White, Charset:Ansi)
MyChart.Show(10, 10, 'Looky here:', 0)
MyChart.Display()

SetFont(FontName, Size, Style, Color, Charset)

SetFont(FontName, Size, Style, Color, Charset)

Sets all the font attributes in preparation for a call to .Show()

Parameters
Parameter Type Description
FontNameStringName of the font to use.
SizeLongThe font size.
StyleLongThe font style.
ColorLongThe font color.
CharSetLongCharset for the font.
Returns

None

Example
Example
Display the text 'Looky here' starting at (10, 10) on the graph region:
MyChart.SetFont('Arial', 12, Font:Regular, Color:White, Charset:Ansi)
MyChart.Show(10, 10, 'Looky here:', 0)
MyChart.Display()

SetPen

SetPen(color, style, width)

Sets all the pen attributes in preparation for a call to .DrawLine(), .DarwPolygon(), .DrawEllipse(), .DrawArc(), .DrawPixel(), etc.

Parameters
Parameter Type Description
ColorStringThe pen color.
StyleLongThe pen style.
WidthLongThe pen width.
Returns

None

Example
Example
Draw a red solid line of width 2:
MyChart.SetPen(Color:Red, Pen:Solid, 2)
MyChart.DrawLine(10,10,100,100)
MyChart.Display()

Set Manipulation Methods

.GetSet

.GetSet(Set)

Loads the record in the SetQ that matches the requested set.

Parameters
Parameter Description Description
SetLongThe set number, as stored in Self.SetQ.Set.
Returns

True if the lookup is successful, false if not.

Example
Example
Manually change the set description of set 3:
If MyChart.GetSet(3)
   Mychart.SetQ.Description = 'Funky Chicken'
   Put(MyChart.SetQ)
End

.SetSetColors

.SetSetColors (Set, <PenColor>, <FillColor>, <ShadowColor>, <ShadeColor>, <Intensity>)

Set the display colors for a set.

Parameters
Parameter Type Description
SetLongThe set number for the set to manipulate.
PenColor<Long>The pen color to use.
FillColor<Long>The fill color to use.
ShadowColor<Long>The shadow color to use (3D only).
ShadeColor<Long>The shade color to use (shading only).
Intensity<long>The brightness of the light source on your objects. Should have a value between 1 and 100. Make sure Autoshading is on.
Returns

None

Notes

The template edits these values on the Colors Tab of the Set Window.

Example
Example
Change set 3's colors:
MyChart.SetSetColor(3, Color:Black, Color:Red, Color:Yellow, Color:White, 75 )

.SetSetDataLabels

.SetSetDataLabels (Set, NoDataLabels, Format, StartAt = 0, MouseMoveFormat = 0)

Set attributes relating to the display of data labels for a set.

Parameters
Parameter Type Description
SetLongThe set number.
NoDataLabelsByteSet to 1 to display no data labels for this set.
FormatStringThe picture token to use for the data values in the data labels of this set.
StartAtLong = 0 The how-many-eth x-axis point to start the data labeling for this set at.
MouseMoveFormatByte = 0 Set to 1 to use the Format to format the data set values in the mouse-over information too.
Returns

None

Example
Example
Change set 3's data labeling attributes:
MyChart.SetSetDataLabels(3, 0, '@N5.2', 1, 1)

.SetSetDescription

.SetSetDescription (Set, Description)

Assign a description to a set.

Parameters
Parameter Type Description
SetLongThe set number of the set to manipulate.
DescriptionStringThe set's description.
Returns

None

Notes

The description property is used as the legend text for a set.

Example
Example
Change set 3 to be the 'Employee Count':
MyChart.SetSetDescription (3, 'Employee Count')

.SetSetType

.SetSetType (Set, Type)

Force a set to be displayed as a different chart type.

Parameters
Parameter Type Description
SetLongThe set number of the set to manipulate.
TypeLongThe chart type to force on this set.
Returns

None

Notes

You will need to call .Draw() for the changes to become apparent on screen.

Example
Example
Change set 3 to be displayed as a bar chart:
MyChart.SetSetType(3, Insight:Bar)
MyChart.Draw()

.SetSetVisible

.SetSetVisible (Set, Visible)

To make a set invisible on the chart, or not.

Parameters
Parameter Type Description
SetLongThe set number of the set to manipulate.
VisibleLong1 = visible, 0 = invisible.
Returns

None

Notes

You will need to call .Draw() for the changes to become apparent on screen.

Example
Example
Make set 3 invisible:
MyChart.SetSetVisible(3, 0)
MyChart.Draw()

.SetSetYAxis

.SetSetYAxis (Set = 0, Autoscale = 3, Minimum = 0, Maximum = 0, Step = 0)

Set the behavior for a set's y-axis.

Parameters
Parameter Type Description
SetLong = 0 The set number of the set to manipulate.
AutoscaleByte = 3 Autoscale the axis? See the AutoScale property for the possible values.
MinimumReal = 0 Force y-axis minimum.
MaximumReal = 0 Force y-axis maximum.
StepReal = 0 Step size between y-axis ticks.
Returns

None

Notes

If Set has the value 0 (which is its default value), the Autoscale, YAxisMin, YAxisMax and YAxisStep fields for each set will be assigned the values passed as parameters, and the YAxisMin, YAxisMax and Autoscale fields of the graph object will be assigned these values as well. Unless SeperateYAxis is set to true, the latter fields will be used to draw a single y-axis. Otherwise, the fields for each individual set will be used to draw a separate y-axis. If Set has a value other than 0, only the fields of the set with set number Set will be adjusted, and these will be used to draw its separate y-axis.

Example
Example
Change set 3 to autoscale:
MyChart.SetSetYAxis(3, True)

Change set 3 to force a 0 to 100 display range on its y-axis:
MyChart.SetSetYAxis (3, False, 0, 100)

.SetSetYLabels

.SetSetYLabels (Set, NoY = 0, Short = 0, Unit = 0, Format)

Set the behavior for a set's y-axis labels.

Parameters
Parameter Type Description
SetLongThe set number of the to manipulate.
NoYByte = 0 Set to 1 to display no y-axis labels for this set.
ShortByte = 0 Set to 1 to have the y-axis labels for this set displayed in short form.
UnitByte = 0 If Short = 1, set this to 1 to add a unit behind each short label.
FormatStringThe format for the y-axis labels of this set.
Returns

None

Notes

Unless SeperateYAxis is not set to true, the ShowYLabels, ShortYAxisLabels, ShortYAxisLabelsUnit and YFormat properties will be used to label a single y-axis. SeperateYAxis needs to be set to true for the fields for each individual set to be used to label a separate y-axis.

Example
Example
Specify the y-axis labeling information for set 3:
MyChart.SetSetYAxis(3, False, 0, 0, '@N5.2')

.SortSets

.SortSets (<SortStyle>, <SortSet>)

Sort set information for a Pareto chart.

Parameters
Parameter Type Description
SortStyle<Long>The sort style to use.
SortSet<Long>The set number for the set to sort. 
Returns

None

Notes

If SortStyle = 1 or 0 then sorting is done with the greatest values at the top.
If SortStyle = -1 then sorting is done with the greatest values at the bottom.

Example
Example
Sort all sets with highest value on top:
MyChart.SortSets(1)

.SwapSets

.SwapSets (Set1, Set2 = 0)

Swap the processing order of two sets of data.

Parameters
Parameter Type Description
Set1LongThe set to move.
Set2Long = 0 The set to swap with.
Returns

None

Notes

If Set2 is omitted, the sets will be cycled as follows:

If Set1 is positive, the first set becomes the last set.
If Set1 is negative, the last set becomes the first set.

If Set1 and Set2 are supplied, then the sets are swapped.

Example
Example
Cycle the data sets so that the first set is moved to the back:
MyChart.SwapSets(1)

Swap sets 3 and 5:
MyChart.SwapSets(3,5), or
MyChart.SwapSets(5,3)

Rendering Methods

.Draw ()

.Draw ()

Draw the chart on the target.

Parameters

None

Returns

None

Notes

This will draw the chart on the currently selected target. If the chart is to be drawn on a report, the target must be explicitly set by calling SetTarget(), and the ReportBand property must be set to the report target band where the chart is.

Example
Example
Draw the chart:
MyChart.Draw()

.PrintGraph

.PrintGraph (DeviceName, ProgrammerID = 0, Width = 220, Height = 170)

Prints the graph.

Parameters
Parameter Type Description
DeviceNameStringThe printer for the output. If this is blank then the "current" printer is used.
ProgrammerIDLong = 0 This method calls .SetReportProperties() with this ID - you can use it to decide which part of the code embedded in .SetReportProperties() you want to execute, if necessary.
WidthLong = 220 Width of output generated.
HeightLong = 170 Height of output generated.
Returns

None

Notes

Note that the Right-Click Print calls this method with a ProgrammerID of 255. Note: In beta 6 and before, this was also used to create WMF files. You should now use the .SaveAs() method to create BMP or PNG files.

Example
Example
Print the graph to the current printer:
ThisGraph1.PrintGraph('')

Print the graph to the Laser Series Printer:
ThisGraph1.PrintGraph('Laser Series Printer')

Print the graph to the current printer, with dimensions 100x100:
ThisGraph1.PrintGraph ('', 1, 100, 100)

.Resize()

.Resize()

Call this if the control resizes.

Returns

None

Notes

Call this procedure if the graph control changes size. This is called automatically when the .Reset() method is called. Call the .Draw() method after calling this if you want the graph itself to redraw.

Example
Example
Resize the graph:
ThisGraph1.Resize()
ThisGraph1.Draw()

SaveAs(FileName)

SaveAs(FileName)

Saves the graph as a BMP or PNG file.

Returns

None

Notes

Call this method to save the graph into either BMP or PNG format. If you are wanting to display the graph later in a Clarion program then use the BMP format (Clarion's Image control can't display PNG images). However, if you are wanting to use the image on a web server then use the PNG format. This is a compressed format, suitable for graphs, which browsers can display.

FAQ: Why PNG and not JPG or GIF? PNG files are losslessly compressed, unlike JPG which is lossy. JPGs tend to corrupt edges quite badly, which means they are not suitable for images with text or fine detail. GIF images are not supported as the format is patented by Unisys, which means a licensing fee would need to be paid by CapeSoft for using the GIF format, as well as by you as a programmer implementing GIF support in your application, as well as a fee for each copy of the software sold. The license fee starts at around $2500.

Example
Example
ThisGraph1.SaveAs('c:\windows\graph1.bmp')
ThisGraph1.SaveAs('graph1.bmp')
ThisGraph1.SaveAs('graph1.png')

SetStyle

SetStyle (Style, StyleType = Style:Data)

Sets the default data or axis style.

Parameters
Parameter Type Description
StyleByteThe built in style number to use. There are currently 28 axis styles and 12 data styles.
StyleTypeByte = Style:Data Valid options are Style:Data and Style:Axis.
Returns

None

Example
Example
Set the default axis and data styles:
ThisGraph1.SetStyle(4, Style:Data)
ThisGraph1.SetStyle(2, Style:Axis)

.Zoom

.Zoom (Factor = 0, Relative = 0, MiddlePoint = 0, DontDraw = 0)

Display a subset of the chart's data.

Parameters
Parameter Type Description
FactorReal = 0 The zoom factor with respect to the original 100% graph. Choose a value between 0 and 100.
RelativeReal = 0 The zoom factor with respect to the current (zoomed) part of the graph you are seeing. Set Factor to 0 if you want to use this.
MiddlePointReal = 0 The point that will be the middle of the subset.
DontDrawbyte = 0 Set to 1 if you don't want .Zoom() to call .Draw() to reflect the changed zoom factor.
Returns

None

Notes

If the MiddlePoint is omitted or 0, a call to .GetPoint() will be made, and this point will be used. .Zoom() manipulates the ShowFromPoint and  ShowToPoint properties. A call to .Draw() is made just before the method completes, unless you pass DontDraw = 1. The ZoomPoint property is set and used by .Zoom() (it contains the last value of MiddlePoint or the result of .GetPoint()), and so is the Zoom property.

Example
Example
Zoom in 25% at the current point:
MyChart.Zoom(25)

Embed Points

.SetLabelFonts ()

.SetLabelFonts ()

Creates an embed point in .Draw() after the data labels have been processed but before they have been drawn to enable you to change the fonts of the individual labels.

Parameters

None

Returns

None

Notes

See the section on the LabelQ for some nifty example code. Also, if you are using the template, make sure you tick the Generate SetLabelFonts() option on the Advanced Tab if you are going to embed code here.

.SetPropSQL (ViewName)

.SetPropSQL (ViewName)

Creates an embed point in .ResetQueue() after the view is opened but before any of its records are read.

Parameters
Parameter Type Description
ViewNameViewThe view that is about to be processed by .ResetQueue().
Returns

None

Notes

Embed any code here that you would like to execute after the view has been opened but before any of its records are read.

Note that this method will only be generated by the template if you are using an SQL backend. If this is not the case and you try to embed code in this method, you may get an error similar to the one described for .SetPointName() in the Common Errors Section of the User Guide.

.SetPoint

.SetPoint (ID)

Creates an embed point in .Data() after the all the Data Properties of the current data point have been set but before this data point is Put back in the DataQ.

Parameters
Parameter Type Description
IDLongThis is the ID as was assigned by .AddItem().
Returns

None

Notes

This method can be used to embed any code that you would to execute after a data point's attributes have been set but before it has been Put back in the DataQ.

Note that this method will only be generated by the template if you have specified some Conditional Point Overrides on the Colors Tab of one of your sets. If this is not the case and you try to embed code in this method, you may get an error similar to the one described for .SetPointName() in the Common Errors Section of the User Guide.

Example
Example
Make all data points at x-axis point 2 red and of triangular shape:
IF self.DataQ.Point = 2
   self.DataQ.FillColor = Color:Red
   self.DataQ.Shape     = Insight:Triangle
END

.SetPointName (ID), string

.SetPointName (ID), string

Creates an embed point in .ResetQueue() allowing you to to specify the point name for every x-axis point, providing it has not yet been assigned by, for example, a call to .AddItem(). To make sure the template generates this method you need to enter a '+' in the Point Name field of the X-Axis Tab.

Parameters
Parameter Type Description
IDLongThis is the ID as was assigned by .AddItem().
Returns

The point name.

Notes

If the point name is stored in the View or Queue, it would typically have been assigned by .AddItem(). If the point name for a given point is not yet assigned then .SetPointName() will be called for that point. You can embed code here that modifies the return value to a custom point name of your choice.

Note that to make sure the template generates this method you need to enter a '+' in the Point Name field of the X-Axis Tab. If this is not the case and you try to embed code in this method, you may get an error as described in the Common Errors Section of the User Guide.

Example

Example
See also Making your own Point Names in the FAQ.

Change the point name for each point to the appropriate month abbreviation:
execute month(fil:date)
  ReturnValue = 'Jan'
  ReturnValue = 'Feb'
  ReturnValue = 'March'
  ReturnValue = 'April'
  ReturnValue = 'May'
  ReturnValue = 'June'
  ReturnValue = 'July'
  ReturnValue = 'Aug'
  ReturnValue = 'Sept'
  ReturnValue = 'Oct'
  ReturnValue = 'Nov'
  ReturnValue = 'Dec'
end

.SetPointNumber

.SetPointNumber (ID), real

Creates an embed point in .ResetQueue() allowing you to to specify the point number for every x-axis point, providing it has not yet been assigned by, for example, a call to .AddItem().

Parameters
Parameter Type Description
IDLongThis is the ID as was assigned by .AddItem().
Returns

The point number.

Notes

If the point number is stored in the View or Queue, it would typically have been assigned by .AddItem(). If the point number for a given point is not yet assigned then .SetPointNumber() will be called for that point. You can embed code here that modifies the return value to a custom point number of your choice.

Note that this method will only be generated by the template if either the Point Number on the Main X-Axis Tab or the Point Number on one of your Set's X-Axis Tabs is an expression. You can force this by entering a single '+' in the entry. If this is not the case and you try to embed code in this method, you may get an error similar to the one described for .SetPointName() in the Common Errors Section of the User Guide.

Example
Example
Change the point number for each point to the month number:
execute month(fil:date)
  ReturnValue = 1
  ReturnValue = 2
  ReturnValue = 3
  ReturnValue = 4
  ReturnValue = 5
  ReturnValue = 6
  ReturnValue = 7
  ReturnValue = 8
  ReturnValue = 9
  ReturnValue = 10
  ReturnValue = 11
  ReturnValue = 12
end

.SetRecordClose

.SetRecordClose (ID), real

Creates an embed point in .ResetQueue() allowing you to to specify the closing value for each record of the view or queue with id number ID, providing it has not yet been assigned by, for example, a call to .AddItem(). If the FC parameter of .AddItem() is omitted, this method is called by .ResetQueue() for each record of the queue or view. The actual effect of this value depends on the graph type. See the Notes below for details.

Parameters
Parameter Type Description
IDLongThis is the ID as was assigned by .AddItem().
Returns

The closing value for the current record.

Notes

See also .AddItem() for more details.
Graph Type FieldClose
Bar / ParetoNot used
Line / Pie / TimeNot used
GanttDuration time
Hi-LoClosing value
Note that this method will only be generated by the template if the Close Field on one of your Set's Set Tabs is an expression (providing your graph is a Gantt or Hi-Lo chart). You can force this by entering a single '+' in the entry. If this is not the case and you try to embed code in this method, you may get an error similar to the one described for .SetPointName() in the Common Errors Section of the User Guide.

Example
Example
Make the closing value the current time (for a Gantt graph):
ReturnValue = clock()

.SetRecordHigh

.SetRecordHigh (ID), real

Creates an embed point in .ResetQueue() allowing you to to specify the high value for each record of the view or queue with id number ID, providing it has not yet been assigned by, for example, a call to .AddItem(). If the FH parameter of .AddItem() is omitted, this method is called by .ResetQueue() for each record of the queue or view. The actual effect of this value depends on the graph type. See the Notes below for details.

Parameters
Parameter Type Description
IDLongThis is the ID as was assigned by .AddItem().
Returns

The high value for the record.

Notes

See also .AddItem() for more details.
Graph TypeFieldHigh
Bar / ParetoTop of the bar
Line / Pie / Time Graph point
GanttStart date
Hi-LoTop of the bar
Note that this method will only be generated by the template if the High Field on one of your Set's Set Tabs is an expression.You can force this by entering a single '+' in the entry. If this is not the case and you try to embed code in this method, you may get an error similar to the one described for .SetPointName() in the Common Errors Section of the User Guide.

Example
Example
Choose a random value for the top of each bar of your Bar graph:
ReturnValue = random(1, 100)

.SetRecordLow

.SetRecordLow (ID), real

Creates an embed point in .ResetQueue() allowing you to to specify the low value for each record of the view or queue with id number ID, providing it has not yet been assigned by, for example, a call to .AddItem(). If the FL parameter of .AddItem() is omitted, this method is called by .ResetQueue() for each record of the queue or view. The actual effect of this value depends on the graph type. See the Notes below for details.

Parameters
Parameter Type Description
IDLongThis is the ID as was assigned by .AddItem().
Returns

The low value for the record.

Notes

See also .AddItem() for more details.
Graph TypeFieldLow
Bar / ParetoBottom of the bar (if the bar is floating)
Line / Pie / Time Not used
GanttStart time
Hi-LoBottom of the bar
Note that this method will only be generated by the template if the Low Field on one of your Set's Set Tabs is an expression. You can force this by entering a single '+' in the entry. If this is not the case and you try to embed code in this method, you may get an error similar to the one described for .SetPointName() in the Common Errors Section of the User Guide.

Example
Example
Choose a random value for the bottom of each bar of your Bar graph:
ReturnValue = random(1, 10)

.SetRecordOpen

.SetRecordOpen (ID), real

Creates an embed point in .ResetQueue() allowing you to to specify the opening value for each record of the view or queue with id number ID, providing it has not yet been assigned by, for example, a call to .AddItem(). If the FO parameter of .AddItem() is omitted, this method is called by .ResetQueue() for each record of the queue or view. The actual effect of this value depends on the graph type. See the Notes below for details.

Parameters
Parameter Type Description
IDLongThis is the ID as was assigned by .AddItem().
Returns

See also .AddItem()  for more details.

Graph TypeFieldOpen
Bar / ParetoNot used
Line / Pie / Time Not used
GanttDuration days
Hi-LoOpening value
Note that this method will only be generated by the template if the Open Field on one of your Set's Set Tabs is an expression (providing your graph is a Gantt or Hi-Lo chart). You can force this by entering a single '+' in the entry. If this is not the case and you try to embed code in this method, you may get an error similar to the one described for .SetPointName() in the Common Errors Section of the User Guide.

Returns

The opening value for the record.

Example
Example
Choose a random value for the opening value of each bar of your Hi-Lo graph:
ReturnValue = random(1, 10)

.SetReportProperties

.SetReportProperties (ProgrammerID)

Creates an embed point in the .PrintGraph() method allowing you to set additional report properties (for example the paper size, report orientation, and so on) before the internal report is printed by PrintGraph(). To make sure the template generates this method you need to go to the Advanced Tab of your Insight control and tick the Generate SetReportProperties() checkbox.

Parameters
Parameter Type Description
ProgrammerIDLongThis is the ProgrammerID that was passed to .PrintGraph(). You can set this to any value when calling .PrintGraph() and then use it here to decide which part of the embedded code should be executed, if necessary.
Returns

None

Notes

Note that to make sure the template generates this method go to the Advanced Tab of your Insight control and tick the Generate SetReportProperties() checkbox. If this is not the case and you try to embed code in this method, you may get an error as described for .SetPointName() in the Common Errors Section of the User Guide.

Example
Example
See Manually Printing Screen Graphs in the User Guide.

.SetSetNumber

.SetSetNumber (ID), long

Creates an embed point in .ResetQueue() allowing you to specify the set number for each record of the view or queue with id number ID, providing that the Set parameter passed to .AddItem() for this view or queue was 0. In this case, this method is called by .ResetQueue() for each record of the queue or view. Use this embed point if you wish the data of a particular view or queue to span multiple sets.
Parameter Type Description
IDLongThis is the ID as was assigned by .AddItem().
Returns

The set number value for the record.

Notes

Use this embed point if you wish the data of a particular view or queue to span multiple sets.

Note that this method will only be generated by the template if you have chosen to Override the Set Number to a non-fixed value. If this is not the case and you try to embed code in this method, you may get an error similar to the one described for .SetPointName() in the Common Errors Section of the User Guide.

Example
Example
Assign the set number of each member of the queue depending on its name:
if PlottingQueue.Name = ' Sales'
  ReturnValue = 1
elsif PlottingQueue.Name = 'Returns'
  ReturnValue = 2
end

.ValidateRecord

.ValidateRecord (ID), byte

Creates an embed point in .ResetQueue() allowing you validate the current record in the view or queue before it is processed. This method is called by .ResetQueue() for each record of the queue or view with id number ID. If it returns false, the current record in the view or queue will be ignored.

Parameters
Parameter Type Description
IDLongThis is the ID as was assigned by .AddItem(). If you are using the template, this is basically the set number of the current set being processed.
Returns

True or false, depending on whether the record is valid.

Notes

You can also use this method to specify an expression for the parent field entered in .AddItem(). In this case, a variable would have been passed as the parent field (PF) in .AddItem(), and you should set this variable in this embed point to whatever expression you need.

Example
Example
The below illustrates how to implement the suggestion mentioned in the Notes above, where ID is being passed as parameter to this ValidateRecord method, and ThisGraph5:Parent:1 is the variable that was passed as the parent field to .AddItem():
ReturnValue = Parent.ValidateRecord(ID)
if ID = 1
ThisGraph5:Parent:1 = MAJ:Number + 1
end