iASP_Chart Component

Overview

Using the iASP_Chart component, you can create professional looking charts very easily. Features include:

  1. Creates JPG, PNG, and BMP formats
  2. 3D features
  3. Supports Response.BinaryWrite
  4. Pie, Bar, Area, and many other styles
  5. Automatically creates legends
  6. Supports multiple series per chart
  7. Charts can be resized and rotated 

Properties

Property

Description

Angle By default the Angle property is set to 0. If you wish to rotate the final chart image, set Angle to the angle of rotation.
AxisGridColor Sets the grid line color of the chart (if present).
AxisGridLines AxisGridLines is true by default and determines if an axis grid is displayed.

Example:

Chart.AxisGridLines = false

AxisHorizFont The AxisHorizFont property exposes the horizontal axis font object. Valid sub-properties are
  • Name : string
  • Size : integer
  • Bold : boolean
  • Italic : boolean
  • Underline : boolean
  • Strikethrough : boolean
  • Weight : smallint

Example:

Chart.AxisHorizFont.Name = "Arial"
Chart.AxisHorizFont.Size = 12
Chart.AxisHorizFont.Bold = true
AxisHorizFontColor AxisHorizFontColor determines what color the horizontal axis font is drawn with.

Example:

Chart.AxisHorizFontColor = vbBlack
AxisLabelFontBottom

AxisLabelFontLeft

These properties expose the axis label font objects. See AxisHorizFont for details.

Example

Chart.AxisLabelFontBottom.Bold = true

AxisLabelFontColor AxisLabelFontColor determines what color the axis label fonts are drawn with.
AxisVertFont The AxisVertFont property exposes the vertical axis font object. See AxisHorizFont for details.
AxisVertFontColor AxisVertFontColor determines what color the vertical axis font is drawn with.
BarLayout If you have multiple bar series in a chart, the BarLayout property specifies how the bar series will be drawn. Valid values are
  • cNone = 0
  • cSide = 1
  • cStacked = 2

Example:

Chart.BarLayout = cNone
BarStyle BarStyle determines the style of the bars drawn for bar series. Valid values are:
  • cRectangle = 0
  • cPyramid = 1
  • cInvPyramid = 2
  • cCylinder = 3
  • cEllipse = 4
  • cArrow = 5
  • cRectGradient = 6

Example:

Chart.BarStyle = cRectGradient
BevelInner The BevelInner property determines whether the inner bevel for the chart is displayed.

Example:

Chart.BevelInner = false
BevelOuter The BevelOuter property determines whether the outer bevel for the chart is displayed.

Example:

Chart.BevelOuter = false
BevelWidth The BevelWidth property determines the width in pixels between the inner and the outer bevels of a panel.

Example:

Chart.BevelWidth = 2
BorderWidth The BorderWidth property determines the width in pixels of the border around a panel.

Example:

Chart.BorderWidth = 1
BottomAxisIncrement The BottomAxisIncrement Property determines the minimum axis increment for the bottom axis.

Example:

Chart.BottomAxisIncrement = 100

BottomWallColor The BottomWallColor property specifies the color used to fill the bottom wall background.

Example:

Chart.BottomWallColor = vbYellow
ChartBGColor The ChartBGColor property specifies the color used to fill the chart background.

Example:

Chart.ChartBGColor = vbWhite
ChartTitleFont The ChartTitleFont property specifies the font characteristics used to draw chart titles. See AxisHorizFont for sub-properties.
ChartTitleFontColor The ChartTitleFontColor property specifies the font color used to draw chart titles.

Example:

Chart.ChartTitleFontColor = vbBlue
ColorDepth The ColorDepth Property sets the color depth of the resulting image. This only affects BMP pictures. The default is 24bit.

Valid values are:

Description Value
1bit 1
4bit 2
8bit 3
15bit 4
16bit 5
24bit 6
32bit 7



Example:

Chart.ColorDepth = 7

ConvertPath Path to optional (user supplied) image conversion utility. This property is used during the call to the ConvertImage method. See ConvertImage details for more information.

Example:

Chart.ConvertPath = "c:\imgconv\myconv.exe"

ConvertParams Parameters used during the call to the ConvertImage method. See ConvertImage details for more information.

Example:

Chart.ConvertParams = "image1.bmp chrt32.xbm"

CurrentSeries The CurrentSeries indicates/sets which series is currently active. For single series charts this will always be 1 but for multi-series charts this value will change each time a new series is added. You can switch between series by modifying this value.

Example:

Chart.CurrentSeries = 2
Error The Error property is used to report any errors that may have occurred during various method calls.

Example:

Response.Write "Error: " & Chart.Error

Expires If the component is an eval version the Expires property will return the date that the component quits functioning.

Example:

Response.Write "Component Expires: " & Chart.Expires
FileName The FileName property specifies the physical path where a file will be saved using the SaveChart method.

Example:

Chart.FileName = "d:\inetpub\wwwroot\images\abc.jpg"
Frame Typically charts have a frame around them. You can hide the grid lines using the AxisGridLines property. If you wish to hide the frame also you can set Frame to false.

Example:

Chart.Frame = false

GradientDirection The chart panel may have a background gradient. The GradientDirection Property determines which direction the gradient should be drawn in. Valid values are:
  • cTopBottom = 0
  • cBottomTop = 1
  • cLeftRight = 2
  • cRightLeft = 3

Example:

Chart.GradientDirection = cTopBottom
GradientEndColor Determines the end color for the gradient.

Example:

Chart.GradientEndColor = vbWhite
GradientStartColor Determines the beginning color for the gradient.

Example:

Chart.GradientEndColor = vbYellow
GradientVisible Determines whether the chart panel gradient is visible or not.

Example:

Chart.GradientVisible = true
Height The Height property determines the height of the chart.

Example:

Chart.Height = 500
HintsBGColor Determines the background color of the chart hints.
HintsFont The HintsFont property specifies the font characteristics used to draw chart hints. See AxisHorizFont for sub-properties.
HintsFontColor The HintsFontColor property specifies the font color used to draw chart hints.

Example:

Chart.HintsFontColor = vbBlue
HintsTransparent Determines whether chart hints are transparent or not.

Example:

Chart.HintsTransparent = true
HintsVisible Determines whether chart hints are visible or not.

Example:

Chart.HintsVisible = true
HLabelStyle, VLabelStyle Sets the Horizontal and Vertical Axis label styles. Valid values are:
Value

Description

0 Automatic
1 None
2 Axis scales
3 Series point marks
4 XLabels

Example:

Chart.HLabelStyle = 3

HorizAxisMax The axis minimums and maximums are automatically set based upon the points you add to the chart but you can override these calculated values. HorizAxisMax determines the maximum value displayed on the horizontal axis.

Example:

Chart.HorizAxisMax = 200
HorizAxisMin The axis minimums and maximums are automatically set based upon the points you add to the chart but you can override these calculated values. HorizAxisMin determines the minimum value displayed on the horizontal axis.

Example:

Chart.HorizAxisMin = 10
Image Image is a read only property that contains the binary data for the current Chart. You can use this to write the binary data directly to the client rather than using the SaveChart method. Your application design should dictate the best method to use. From ASP you can use Response.BinaryWrite to write this image data to the client. Be sure and set ContentType to the proper content-type. Currently the Image property only supports JPEG or PNG data. See the included file BinWChrt.asp for an example of how to use this property. Set the ImageFormat property to JPG or PNG before using this property.
ImageFormat ImageFormat determines what graphics format the image will be saved to. Valid values are
  • JPG = 1
  • BMP = 2
  • PNG = 3

Example:

Chart.ImageFormat = 3
JPEGQuality If the ImageFormat is set to JPEG then the JPEGQuality property specifies the quality of the JPEG image to be saved. Valid values are 1-100.

Example:

Chart.JPEGQuality = 95
LeftAxisIncrement Determines the axis increment for the left axis.

Example:

Chart.LeftAxisIncrement = 100

LeftWallColor The LeftWallColor property specifies the color used to fill the left wall background.

Example:

Chart.LeftWallColor = vbYellow
LegendFont The LegendFont property exposes the Legend font object. See AxisHorizFont for details.
LegendFontColor The LegendFontColor property specifies the font color used to draw legend text.

Example:

Chart.LegendFontColor = vbGreen
LegendPosition Determines where the legend should be placed on the chart. Valid values are:
  • cLeft = 0
  • cRight = 1
  • cTop = 2
  • cBottom = 3

Example:

Chart.LegendPosition = cRight
LegendStyle Determines the style of the legend. Valid values are:
  • cAuto = 0
  • cSeries = 1
  • cValues = 2
  • cLastValues = 3

Example:

Chart.LegendStyle = cSeries
LegendTextStyle Determines how Legend text items will be formatted. The following values are legal.

Name

Description

Value
Simple Point label only 0
LeftValue Point value and point label 1
RightValue Point label and point value 2
LeftPercent Percent and point label 3
RightPercent Point label and percent 4
XValue Point's X value (only for series with X values) 5

Example:

Chart.LegendTextStyle = 3

LegendVisible Determines if the legend will be displayed or not.

Example:

Chart.LegendVisible = false
LineWidth LineWidth is the width of the line that's drawn for the following series types: QuickLine, Line, and Point. Setting the LineWidth sets the line width for the CurrentSeries only.

Example:

Chart.LineWidth = 3

PanelColor Determines the color used to fill the chart panel background.

Example:

Chart.PanelColor = vbWhite
ProgressiveJPEGEncoding ProgressiveJPEGEncoding determines whether an image can be progressively displayed when it is decompressed. ProgressiveJPEGEncoding is off by default.

Example:

Chart.ProgressiveJPEGEncoding = true
RegisteredTo Returns the name of the customer or company who purchased the component or "Evaluation" if the component is an evaluation copy.

Example:

Response.Write "Registered To: " & Chart.RegisteredTo
SeriesColor Determines the color of the current series.

Example:

Chart.SeriesColor = vbRed
SeriesInLegend SeriesInLegend determines if the CurrentSeries is include in the legend. The default is true.

Example:

Chart.SeriesInLegend = false
SeriesTitle Determines the title of the current series.

Example:

Chart.SeriesTitle = "'97 Widget Shipments"
Stairs For Line and Area series you can create stair stepped lines if you set Stairs = true.
Version Gets the internal component version number.

Example:

Response.Write "Component Version: " & Chart.Version
VertAxisMax The axis minimums and maximums are automatically set based upon the points you add to the chart but you can override these calculated values. VertAxisMax determines the maximum value displayed on the vertical axis.

Example:

Chart.VertAxisMax = 200
VertAxisMin The axis minimums and maximums are automatically set based upon the points you add to the chart but you can override these calculated values. VertAxisMin determines the minimum value displayed on the vertical axis.

Example:

Chart.VertAxisMin = 10
View3D The View3D property determines if the chart will have a 3D look or not. The default is true.

Example:

Chart.View3D = false
Width The Width property determines the width of the chart.

Example:

Chart.Width = 500

Methods

Method

Parameters

Return Value

Description

AddAxisLabel intAxis, strValue (none) Sets the Axis label

intAxis may be

  • 1 = Left Axis
  • 2 = Bottom Axis
AddCandle strDate, dblOpen, dblHigh, dblLow, dblClose (none) Adds a new candle point to a Candle series. See the demo code AspChrt5.asp for a demonstration of this routine.
AddSeries intSeriesType (none) Adds a new series to the chart. Valid values for intSeriesType are:
  • cBar = 1
  • cHBar = 2
  • cPie = 3
  • cArea = 4
  • cLine = 5
  • cPoint = 6
  • cCandle = 7
  • cQuickLine = 8

After adding a new series you will call AddValue to add values to the current series except for Candle charts which call AddCandle.

AddValue dblValue, strLabel, intColor (none) Adds new points to the current series.
AddXY dblXValue, dblYValue, strXLabel, intColor (none) Inserts a new point in the Series having values dblX, dbl. strXLabel may be empty ("").
AddXYArray array of AddXY values (none) Allows adding a large number of XY points to a chart efficiently. See AspChrt9.asp for a demo of how to use AddXYArray.
AddY dblYValue, strLabel, intColor (none) Inserts a new point in the Series having the value dblY. strLabel may be empty ("").
ChartTitleAdd strTitle (none) Adds the strTitle text to the chart title.
ChartTitleClear (none) (none) Clears any text assigned to the chart title.
Clear (none) (none) Clears the chart, clears all series and values added.
ConvertImage bolEraseSource Boolean (true/false) The ConvertImage method allows you to convert images into formats not inherently supported by AspChart. Here's how it works:
  1. Assign the path and filename of your image conversion utility to ConvertPath.
  2. Assign the command-line parameters that your image conversion program requires to the ConvertParams property. Be sure and use explicit pathnames if necessary.
  3. Assign the FileName property so the Chart component knows where to save the chart to.
  4. Call ConvertImage

Here's what happens:

  1. AspChart will save the image to FileName.
  2. AspChart will execute your image conversion utility with the ConvertPath and ConvertParams you specified.
  3. AspChart will optionally erase (bolEraseSource) the file specified in FileName.

When debugging your setup it is best to specifiy bolEraseSource as false. Be sure the anonymous IIS user or authenticated users who access this component are able to execute the ConvertPath utility.

LoadBackdrop strFileName Boolean (true/false) Loads a BMP or JPG to be used as the chart background.

Example:

Chart.LoadBackdrop ("d:\pub\images\corplogo.jpg")

SaveChart (none) Boolean (true/false) Saves the chart to the FileName property file.
ShowMinorTicks LeftAxis, BottomAxis N/A Sets whether or not the Left and Bottom axis will show minor ticks.

Example:

Chart.ShowMinorTicks false, false

If you require technical support please send complete details about the problem you are having to support@halcyonsoft.com.


Copyright © 1998-2002, Halcyon Software Inc. All rights reserved.