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

CapeSoft Insight Graphing
Technical Guide

Download Latest Version
Installed Version Latest Version
Documentation Guide
Technical Guide

Insight Class Properties Insight Class Methods

Insight Class Properties

General Properties

ActiveInvisible Byte Usually 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.
BackgroundColor Long The color to use as the wallpaper for the graph. Defaults to COLOR:Silver. This property is ignored if the BlackAndWhite property is set.
BackgroundShadeColor String(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.
BackgroundPicture Long A BMP file to use as the wallpaper for the graph. This property is ignored if the BlackAndWhite property is set.
BorderColor Long The color of the border around the graph. Defaults to Color:Black.
Control Long The bounding control (graph region) )equate. Charts will be drawn within the bounds of this control.
Depth Long The 3D depth of the chart (in 1/1000 inch).
MinPointWidth Long If 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.
MouseMovePointValueFormat String(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.
Points Real The number of data points to plot. (This does not apply to Time charts). Note that this property is mostly for internal use.
PrintPortrait Byte Set this to 1 if you want your graphs to print out in portrait style as opposed to landscape.
ReportBand Long The target band on the report. This will be cleared after each call to Draw()
SavedGraphType Long The graph type selected by the user the last time the application was closed.
SumariseAllSets Byte By 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.
SuppressBusyWindows Byte By 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.
Type Long The type of chart. Valid options are Insight:Line, Insight:Bar, Insight:Pie, Insight:Time, Insight:Gantt, Insight:Scatter and Insight:Pareto.
UnlockThreadForPrint Long Unlock 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.
WriteLog Byte If this is set to 1 then debugging information is written to the SysInternals DebugView program.
OpenText, CloseText, HighText,LowText String(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

AspectRatio Real For 2D pie charts, if this is set to 1 the pie will always be circular (as opposed to elliptical).
AxisStyle Byte For "built-in" graph styles (for the axis). To set the style use the .SetStyle() method, with the style type set to Style:Axis.
BlackAndWhite Byte Set this property if the graph must only use black and white colors when drawing. Mostly used when printing to black and white printers.
DataStyle Byte For "built-in" graph styles (for the data). To set the style use the .SetStyle() method, with the style type set as Style:Data.
DrawMissing Byte Draw through data points not supplied. (Line charts)
Fill Long The area below the data points will be filled (Line and Time charts)
FillToZero Long The area between the data points and the Zero mark will be filled (Line and Time charts)
Float Byte This will allow floating bars based on the minimum values sent as data (Bar charts - see also .Data())
InnerRadius Long This is the value (as a percentage from 0 to 100) of the inside radius of the donut (pie charts only)
LineStyle Long The style to use for drawing the Line. Valid options are Pen:Solid, Pen:Dash, Pen:Dot, Pen:DashDot and Pen:DashDotDot
LineWidth Long The 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.
MaxPieRadius Long Sets 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.
Pattern Byte Set 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.
PieAngle Real Set 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.
PieLabelLineColor Long Set this to the color you would like the lines connecting each label to its respective pie slice to be.
PointWidth Real The width the data point display should occupy of the allocated point display width.
Shape Byte Defaults 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.
SortSet Long The data set to sort on for pareto charts.
SortStyle Long The sort style. 0=none, 1 = high value on bottom and -1 = high value on top.
SquareWave Byte Set the default for the lines on the graph to be square waves.
Stacked Byte For data value stacking (bar, line and pareto charts). Set to 1 or 0.
StackLines Byte When 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()).
ZCluster Byte Z-cluster bar charts. Bars at the same point will be stacked behind each other.

Data Label Properties

ColorDataLabels Byte Color the data labels the same as the set color.
DataFont String(50) The font to use for the data labels.
DataFontColor Long The font color to use for the data labels.
DataFontHeight Long The font height to use for the data labels.
DataFontStyle Long The font style to use for the data labels.
DataLabelFormat String(50) The picture token to use to format data values for label display.
DataFontCharSet Long The charset for the data label font.
DataFontAngle Long Use 0 or 90.
PieLabelLines Byte The 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.
PiePercentFormat String(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.
ShortDataLabels Byte The 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).
ShortDataLabelsUnit Byte If set to 1 then the unit for the Data Label is displayed (see ShortDataLabels above).
ShowDataLabels Byte Label the data points?
ShowDataLabelsEvery Long Set to n to show the data labels every n points.
ShowDataLabelsPercent Byte Show data labels as a percentage of the total (pie chart only).
ShowDataLabelsValue Byte Show data labels as a value (pie chart only).
ShowDataLabelsText Byte Show the name of the slice in the data label (pie chart only).

Grid Properties

AutoXGridTicks Byte If this is on, Insight will automatically calculate and use the optimum number of x-axis grid lines to use.
AutoYGridTicks Byte If this is on, Insight will automatically calculate and use the optimum number of y-axis grid lines to use.
BackBorder Byte Draw a border around the back wall of the chart (useful for 2D charts only).
BackFillColor Long The fill color for the chart background grid.
BackLineColor Long The line color for the chart background grid.
BaseFillColor Long The fill color for the chart base grid.
BaseLineColor Long The line color for the chart base grid.
GridLineWidth Long The linewidth to use to draw the grid frame.
MaxXGridTicks Long The maximum number of x-axis grid lines to use.
MaxYGridTicks Long The maximum number of y-axis grid lines to use.
RightBorder Long The minimum gap to leave on the right hand side of the graph.
SideFillColor Long The fill color for the chart side grid.
SideLineColor Long The line color for the chart side grid.
XGridColor Long The color of the x-axis grid lines.
XGridLineWidth Long The thickness of the x-axis grid lines.
XGridStyle Long The penstyle for the x-axis grid. Valid options are Pen:Solid, Pen:Dash, Pen:Dot, Pen:DashDot and Pen:DashDotDot.
XGridTicks Long The 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.
YGridColor Long The color of the y-axis grid lines.
YGridLineWidth Long The thickness of the y-axis grid lines.
YGridStyle Long The penstyle for the y-axis grid. Valid options are Pen:Solid, Pen:Dash, Pen:Dot, Pen:DashDot and Pen:DashDotDot.
YGridTicks Long The 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

HeaderFont String(50) The font to use for the header text.
HeaderFontColor Long The font color to use for the header text.
HeaderFontHeight Long The font height to use for the header text.
HeaderFontStyle Long The font style to use for the header text.
HeaderFontCharset Long The font charset to use for the header text.
HeaderName String(255) The header text.
LegendFont String(50) The font to use for the legend text.
LegendFontColor Long The font color to use for the legend text.
LegendFontHeight Long The font height to use for the legend text.
LegendFontStyle Long The font style to use for the legend text.
LegendFontCharset Long The font charset to use for the legend text.
LegendAngle Long If this is set to 0 then text is written horizontally, if it's set to 90 then the text is written vertically.
LegendStacked Long If 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).
LegendPosition Long The 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.
LegendText Long Used in Pie charts. If ticked then the name of the point will appear in the legend.
LegendValue Long Used in Pie charts. If ticked then the value of the point will appear in the legend.
LegendPercent Long Used in Pie charts. If ticked then the percent of the point will appear in the legend.

X-Axis Properties

AutoXLabels Byte Automatically generate labels for the x-axis.
DisplayFrom Real The 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()).
DisplayFromTime Real The 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()).
DisplayTo Real The 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()).
DisplayToTime Real The 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()).
DisplayOnX Byte What to display on the x-axis. 0 = don't display, 1 = display PointNumber and 2 = display PointName.
LabelsTimeFormat String(50) The format for the time graph's x-axis labels. Of the form @d5+@t1 or @t4+@d3.
LineFromZero Long For Line graphs, start the x-axis at 0 instead of at 1.
ShowXLabels Long Display x-axis labels (or not).
ShowXLabelsCount Long Show 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.
ShowXLabelsEvery Long Show an x-axis label every n points.
SpreadXLabels Byte spreads the x-axis labels equally across the X-Axis. Useful for graphs that have an uneven distribution of Point Numbers.
XAxisLabelsPosition Byte 0 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.
XAxisLabelsJustify Byte 0 = Right, 1 = Left and 2 = Center.
XAxisName String(255) The x-axis name text.
XFont String(50) The font to use for the x-axis labels.
XFontColor Long The font color to use for the x-axis labels.
XFontHeight Long The font height to use for the x-axis labels.
XFontStyle Long The font style to use for the x-axis labels.
XFontCharSet Long The font charset to use for the x-axis labels.
XFontAngle Long The font angle to use for the x-axis labels. 0 or 90.
XNameFont String(50) The font to use for the x-axis name.
XNameFontColor Long The font color to use for the x-axis name.
XNameFontHeight Long The font height to use for the x-axis name.
XNameFontStyle Long The font style to use for the x-axis name.
XNameFontCharSet Long The font charset to use for the x-axis name.

Y-Axis Properties

AutoScale Byte Automatically 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.
PercentSetNum Long If 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.
SeparateYAxis Byte Use separate y-axis values for each data set.
ShowYLabels Byte Label the y-axis (or not).
ShortYAxisLabels Byte The 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).
ShortYAxisLabelsUnit Byte Add the unit (K,M) to the short label (see ShortYAxisLabels above).
YAxisLabelsPosition Byte Set to 0 for left and 1 for Right. For Pareto and Gantt graphs, set this to 0 for top and 1 for bottom.
YAxisLabelsJustify Byte Set to 0 for Right, 1 for Left, or 2 for Center justify.
YAxisMax Real The y-axis maximum value (when SeparateYAxis = 0 and AutoScale = Scale:None).
YAxisMin Real The y-axis minimum value (when SeparateYAxis = 0 and AutoScale = Scale:None).
YAxisName String(255) The y-axis label text.
YFont String(50) The font to use for the y-axis labels.
YFontColor Long The font color to use for the y-axis labels.
YFontHeight Long The font height to use for the y-axis labels.
YFontStyle Long The font style to use for the y-axis labels.
YFontCharSet Long The font charset to use for the y-axis labels.
YFontAngle Long Use 90 to draw label text vertically, 0 for horizontal.
YFormat String(50) The picture token to use for format y-axis values for label display.
YIgnoreInvisibleSets Byte Ignore invisible sets when auto-scaling the y-axis.
YNameFont String(50) The font to use for the y-axis name.
YNameFontHeight Long The font height to use for the y-axis name.
YNameFontStyle Long The font style to use for the y-axis name.
YNameFontCharset Long The font charset to use for the y-axis name.
YNameAngle Long Use 90 to draw the name vertically, 0 for horizontal.
YNameFontColor Long The font color to use for the y-axis name.

Shading Properties

AutoShade Byte If set to 1, shading will be used on displays with more than 256 colors.
LongShade Byte If set to 1, shading will be done relative to the axis, not to the data point value.
RightShade Byte If set to 1, Insight will shade from left to right.
ShadeBack Byte If set to 1, the chart background grid will be shaded.
TopShade Byte If set to 1, Insight will shade from top to bottom.

Zooming Properties

PaperZoom Long Use 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.
ShowFromPoint Real Data point to show from (non-Time charts). Mostly for internal use (see .Zoom()).
ShowFromPointTime Real Time point to show from (Time charts). Mostly for internal use (see .Zoom()).
ShowToPoint Real Data point to show to (non-Time charts). Mostly for internal use (see .Zoom()).
ShowToPointTime Real Time point to show to (Time charts). Mostly for internal use (see .Zoom()).
WorkSpaceWidth Long The 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.
WorkSpaceHeight Long See WorkSpaceWidth above.
Zoom Long Percentage to zoom in and out of of full point range. Mostly for internal use (see .Zoom()).
ZoomPoint Real The 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.

Set Long The 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.
DataLabelFormat String(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.
LabelDataStartPosition Long Setting this to n will cause the data labeling for this set to only start at the n'th x-axis point.
NoDataLabels Byte Set to True or False. Allows you to suppress the data labels for this set.
NoYAxisLabels Byte Set 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.
SetDescription String(100) The description of the set. This is used when setting the legend text and the point summary information. See .SetSetDescription().
ShortYAxisLabels Byte Set to True or False. See the entry with the same name under Y-Axis Properties (only useful if SeperateYAxis is on).
ShortYAxisLabelsUnit Byte Set to True or False. See the entry with the same name under Y-Axis Properties (only useful if SeperateYAxis is on).
YAxisFormat String(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.
AutoScale Byte This 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).
Type Long Allows you to change the graph type of this set so that you can, for example, include a Line in a Bar chart. See .SetSetType()
Fill Long Applies 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.
FillToZero Long Applies 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.
MouseMoveFormat Byte Specifies the format the y-axis values for this set in the mouse-over information should be displayed in.
Points Long Limits 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".
SquareWave Byte Applies 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.
YAxisMax Real See the entry with the same name under Y-Axis Properties (only useful if SeperateYAxis is on).
YAxisMin Real See the entry with the same name under Y-Axis Properties (only useful if SeperateYAxis is on).
YAxisStep Real See 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.
PenColor Long The pen color used for drawing this set. See .SetSetColors().
FillColor Long The fill color used for drawing this set. See SetSetColors().
ShadeColor Long The shade color used for drawing this set. See SetSetColors().
ShadowColor Long The shadow color used for drawing this set. See SetSetColors().
Intensity Long The brightness of the light source on your objects. Should have a value between 1 and 100. Make sure Autoshading is on. See SetSetColors().
LineStyle Long Set the style of the line used when drawing this set. Valid options are Pen:Solid, Pen:Dash, Pen:Dot, Pen:DashDot,and Pen:DashDotDot.
LineWidth Long Sets the line width used when drawing this set.
PointWidth Real Specifies 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.
Pattern Byte Sets the pattern for this particular set. Use Insight:Auto to use the default pattern for this set.
Shape Byte Sets 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.
Visible Byte Set 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.

Set Long The set number of the set that the data point belongs to.
Count Long This is an internal property that is set by .ResetQueue(). It holds the number of child records for this data point.
Point Real The 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).
ValueMin Real For floating bars, this is the y-axis value for the bottom of the bar.
ValueMax Real This is the data value (where the point should be plotted on the y-axis).
ValueOpen Real For Hi-Lo graphs, this is the opening value.
ValueClose Real For Hi-Lo graphs, this is the closing value.
The following properties override the ones at the Set Level.
PenColor Long The pen color used for drawing this data point.
FillColor Long The fill color used for drawing this data point.
ShadeColor Long The shade color used for drawing this data point.
ShadowColor Long The shadow color used for drawing this data point.
Intensity Long The brightness of the light source on your objects. Should have a value between 1 and 100. Make sure Autoshading is on.
LineStyle Long Set the style of the line used when drawing this point. Valid options are Pen:Solid, Pen:Dash, Pen:Dot, Pen:DashDot, and Pen:DashDotDot.
LineWidth Long Sets the width of the line used when drawing this point.
Pattern Byte Sets the pattern for this particular point. Use Insight:Auto to use the default pattern for this set number. 
Shape Byte Sets 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.
Visible Byte Set 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:
Type Long Choose between Label:XAxis and Label:YAxis. For pies, choose Label:Xaxis.
Set long Internal use. No touching.
Point long The x-axis point number for which this is a label.
Value real The y-axis point for which this is a label.
DisplayText String(100) The text to display for the label.
DisplayText2 String(100) In case of multi-lined labels (pie charts only), this would be line two of the label.
DisplayText3 String(100) In case of multi-lined labels (pie charts only), this would be line three of the label.
OriginalText String(100) Internal use. No touching.
X long x-coordinate of the label, in pixels. For internal use, really.
Y long y-coordinate of the label, in pixels. For internal use, really.
W long Width of the label, in pixels. For internal use, really.
H long Height of the label, in pixels. For internal use, really.
StartAngle real Start angle of the pie slice for which this is a label. For internal use, really.
EndAngle real End angle of the pie slice for which this is a label. For internal use, really.
FontName String(40) Name of the font to use for this label. Leave blank if no override desired.
FontSize long Size of the font to use for this label. Leave at 0 if no override desired.
FontColor long Color of the font to use for this label. Leave at -1 if no override desired.
FontCharSet long Charset of the font to use for this label. Leave at 0 if no override desired.
FontStyle long Style of the font to use for this label. Leave at 0 if no override desired.
XOffSet long Set this to the number of pixels you want the label to be shifted horizontally from where Insight was going to draw it originally.
YOffSet long Set 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)

Description

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

Parameters
Parameter Type Description
Type Long Either Label:XAxis or Label:Yaxis.
Value Real Axis value of the line being drawn.
LabelText String Label text of the line.
PenColor Long = -1 Color of the line. If omitted then the usual color for that axis is used.
PenWidth Long = -1 Width of the line. If omitted then the usual width for that axis is used.
PenStyle Long = -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.
LabelColor Long = -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.
XOffSet Long = 0 Set this to the number of pixels you want the label to be shifted horizontally from where Insight was going to draw it originally.
YOffSet Long = 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.
ORLabelText Long = 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)

Description

Fetch the Standard Windows Colors.

Parameters
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
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

Description

Initialize the object for use.

Parameters
Parameter Type Description
Control Long The bounding control (graph region) )for the chart.
Type Long = 1 The type of chart.
Points Real = 1 The number of data points.
Returns

True if successful, false if not.

Notes

The points parameter is not required for Time charts.

Example

Example
Initialize the object for a Bar chart with 12 points to be draw in ?Region1.
Success# = MyChart.Init (?Region1, 12)

.Kill

.Kill

Description

Clean up the object resources after use.

Parameters

None

Returns

None

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

.SetMouseMoveParameters

.SetMouseMoveParameters (SumariseAllSets, MouseMovePointValueFormat)

Description

To set some properties relating to the mouse move summary display.

Parameters
Parameter Type Description
SumariseAllSets Long Sets the SumariseAllSets property.
MousePointValueFormat String Sets the MouseMovePointValueFormat property
Returns

None

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

.ToClipBoard

.ToClipBoard ()

Description

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)

Description

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

Parameters
Parameter Type Description
pNewControl Long The control which will contain the new image that the Insight object will create to draw the graph on.
pImageControl Long = 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)

Description

Switches mirroring text on graph on or off.

Parameters
Parameter Type Description
pMirror Long Set 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

Description

Calculates the chart point that the mouse vertical is at.

Parameters
Parameter Type Description
Set *Long The set number where the mouse is. This value is filled in by the method.
Point *Real The 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

Description

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

Parameters
Parameter Type Description
Set Long=0 The set number.
Point Real=0 The 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

Description

Get the value for a point at the given set.

Parameter
Parameter Type Description
Set Long=0 The set to get the value for.
Point Real=0 The point at which to get the value for the given Set.
LookBack Long=0 The direction in the data set to look for the closest value.
TreatLinesAsDiscrete Byte=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)

Description

Get the mouse coordinates.

Parameter
Parameter Type Description
MouseX *Long The x-axis point, in pixels. This value is filled in by the method.
MouseY *Long The 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)

Description

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

Parameter
Parameter Type Description
IPN Long Include Point Name. Set to 1 to include the point name in the summary, or zero to leave it off.
Separator String The 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)

Description

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

Parameters
Parameter Type Description
Set Long The 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>)

Description

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.)

Parameter
Parameter Type Description
ID Long This 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.
Set Long Sets 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 / Pareto Top of the bar Bottom of the bar (if the bar is floating) Not used Not used
Line / Pie / Time Graph point Not used Not used Not used
Gantt Start Date Start time Duration days Duration time
Hi-Lo Top of the bar Bottom of the bar Opening value Closing 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)

Description

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

Parameters
Parameter Type Description
Set Long The 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)

Description

Clear data values from the chart to plot.

Parameters
Parameter Type Description
Set Long = 0 The 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 ()

Description

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>)

Description

Send data values to the chart to plot (adds a data point to the DataQ).

Parameters
Parameter Type Description
Set Long The set this data point belongs to .See the DataQ.
Point Real The 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)

Description

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

Parameters
Parameter Type Description
ID Long This 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>)

Description

Send data values to a Time chart to plot.

Parameters
Parameter Type Description
Set Long The set this value belongs to.
Date Long The date for the point.
Time Long The 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)

Description

Resets the data to be graphed.

Parameters
Parameter Type Description
Force Byte = 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)

Description

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
Set Long The 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

Description

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)

Description

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
Set Long The data set the point belongs to.
Point Real The data point for the data label.
Label String The 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)

Description

Sets the text for the specified x-axis label.

Parameters
Parameter Type Description
Point Real The point for the x-axis label.
Label String The label text.
Overwrite Long = 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]

Description

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]

Description

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)

Description

Clear an x-axis label.

Parameters
Parameter Type Description
Point Real = 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]

Description

Clear the y-axis labels from theLabelQ.

Parameters

None

Returns

None

Notes

Called internally by the .AddYLabels() method.

Example
Example
MyChart.ClearLabelY()

.ClearLabelData

.ClearLabelData (Set = 0, Point = 0)

Description

Clear data label(s).

Parameters
Parameter Type Description
Set Long = 0 The set to clear the data labels for.
Point Real = 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

Description

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

Parameters
Parameter Type Description
Type Long Choose one of Label:YAxis, Label:XAxis or Label:Data. Pie Chart labels are of type Label:Xaxis.
Set Long The set the label belongs to. X-axis labels usually belong to set 1. Y-axis labels belong to set 1 unless SeperateYAxis is on.
Point Real The 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()

Description

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)

Description

Draw an arc on the chart.

Parameters
Parameter Type Description
X Long X-coordinate of the box bounding the ellipse.
Y Long Y-coordinate of the box bounding the ellipse.
W Long Width of the box bounding the ellipse.
H Long Height of the box bounding the ellipse.
StartAngle Real In 10ths of a degree (i.e. 3600 = 360 degrees).
EndAngle Real In 10ths of a degree (i.e. 3600 = 360 degrees).
PenColor Long Color of the arc.
FillColor Long = Color:None Color to fill the area bounded by the arc with.
ShadeColor Long = Color:White Shade color for the filled area of the arc.
Shade Long = 0 Percentage where shade highlights.
StartRadius Long = 0 A percentage = i.e. 1 to 100.
EndRadius Long = 0 A percentage = i.e. 1 to 100.
DropHeight Long = 0 3D height of the arc drop.
DropColor Long = Color:None Color 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)

Description

Draws an ellipse.

Parameters
Parameter Type Description
X Long X-coordinate of the box bounding the ellipse.
Y Long Y-coordinate of the box bounding the ellipse.
W Long Width of the box bounding the ellipse.
H Long Height of the box bounding the ellipse.
FillColor Long Color to fill the ellipse with.
Depth Long the size of the depth on the ellipse. Set to 0 to have no depth.
DepthColor Long The color to use for the depth part of the ellipse.
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, 100, 50, Color:Red, 0, Color:None
)
MyChart.DrawEllipse(200, 20, 100, 50, Color:Red, 9, Color:Maroon)
MyChart.Display()

DrawLine

DrawLine(X, Y, W, H)

Description

Draws a Line.

Parameters
Parameter Type Description
X Long X-coordinate of the starting point of the line, starting at the top left-hand corner.
Y Long Y-coordinate of the starting point of the line, starting at the top left-hand corner.
W Long Horizontal length of the line, going right from (x, y).
H Long Vertical 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)

Description

Draws a single pixel.

Parameters
Parameter Type Description
X Long X-coordinate of the pixel.
Y Long Y-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)

Description

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:White The shade color for the polygon.
Depth Long = 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.
Pattern Long = 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.
Horizontal Long = 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

Show(X, Y, Text, Rotation)

Description

Displays text on the graph region.

Parameters
Parameter Type Description
X Long X-coordinate of the bottom left-hand corner of the text.
Y Long Y-coordinate of the bottom left-hand corner of the text.
Text Long Text you want displayed.
Rotation Long 0 (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

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

Description

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

Parameters
Parameter Type Description
FontName String Name of the font to use.
Size Long The font size.
Style Long The font style.
Color Long The font color.
CharSet Long Charset 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)

Description

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

Parameters
Parameter Type Description
Color String The pen color.
Style Long The pen style.
Width Long The 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(Set)

.GetSet(Set)

Description

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

Parameters
Parameter Type Description
Set Long The 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>)

Description

Set the display colors for a set.

Parameters
Parameter Type Description
Set Long The 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)

Description

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

Parameters
Parameter Type Description
Set Long The set number.
NoDataLabels Byte Set to 1 to display no data labels for this set.
Format String The picture token to use for the data values in the data labels of this set.
StartAt Long = 0 The how-many-eth x-axis point to start the data labeling for this set at.
MouseMoveFormat Byte = 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)

Description

Assign a description to a set.

Parameters
Parameter Type Description
Set Long The set number of the set to manipulate.
Description String The 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)

Description

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

Parameters
Parameter Type Description
Set Long The set number of the set to manipulate.
Type Long The 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)

Description

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

Parameters
Parameter Type Description
Set Long The set number of the set to manipulate.
Visible Long 1 = 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)

Description

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

Parameters
Parameter Type Description
Set Long = 0 The set number of the set to manipulate.
Autoscale Byte = 3 Autoscale the axis? See the AutoScale property for the possible values.
Minimum Real = 0 Force y-axis minimum.
Maximum Real = 0 Force y-axis maximum.
Step Real = 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)

Description

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

Parameters
Parameter Type Description
Set Long The set number of the to manipulate.
NoY Byte = 0 Set to 1 to display no y-axis labels for this set.
Short Byte = 0 Set to 1 to have the y-axis labels for this set displayed in short form.
Unit Byte = 0 If Short = 1, set this to 1 to add a unit behind each short label.
Format String The 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>)

Description

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)

Description

Swap the processing order of two sets of data.

Parameters
Parameter Type Description
Set1 Long The set to move.
Set2 Long = 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

.DrawGraph

.DrawGraph ()

Description

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.DrawGraph()

.PrintGraph

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

Description

Prints the graph.

Parameters
Parameter Type Description
DeviceName String The printer for the output. If this is blank then the "current" printer is used.
ProgrammerID Long = 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.
Width Long = 220 Width of output generated.
Height Long = 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()

Description

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

SaveAs(FileName)

Description

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)

Description

Sets the default data or axis style.

Parameters
Parameter Type Description
Style Byte The built in style number to use. There are currently 28 axis styles and 12 data styles.
StyleType Byte = 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)

Description

Display a subset of the chart's data.

Parameters
Parameter Type Description
Factor Real = 0 The zoom factor with respect to the original 100% graph. Choose a value between 0 and 100.
Relative Real = 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.
MiddlePoint Real = 0 The point that will be the middle of the subset.
DontDraw byte = 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 ()

Description

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

.SetPropSQL (ViewName)

Description

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

Parameters
Parameter Type Description
ViewName View The 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)

Description

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
ID Long This 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

.SetPointName (ID), string

Description

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
ID Long This 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

Description

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
ID Long This 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

Description

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
ID Long This 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 / Pareto Not used
Line / Pie / Time Not used
Gantt Duration time
Hi-Lo Closing 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

Description

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
ID Long This is the ID as was assigned by .AddItem().
Returns

The high value for the record.

Notes

See also .AddItem() for more details.

Graph Type FieldHigh
Bar / Pareto Top of the bar
Line / Pie / Time Graph point
Gantt Start date
Hi-Lo Top 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

Description

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
ID Long This is the ID as was assigned by .AddItem().
Returns

The low value for the record.

Notes

See also .AddItem() for more details.

Graph Type FieldLow
Bar / Pareto Bottom of the bar (if the bar is floating)
Line / Pie / Time Not used
Gantt Start time
Hi-Lo Bottom 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

Description

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
ID Long This is the ID as was assigned by .AddItem().
Returns

The opening value for the record.

Notes

See also .AddItem() for more details.
Graph Type FieldOpen
Bar / Pareto Not used
Line / Pie / Time Not used
Gantt Duration days
Hi-Lo Opening 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.

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)

Description

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
ProgrammerID Long This 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

Description

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.

Parameters
Parameter Type Description
ID Long This 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

Description

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
ID Long This 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