ChartDirector Ver 4.1 (ColdFusion Edition)

FinanceChart


FinanceChart is a financial charting library built on top of the main ChartDirector library. It extends MultiChart by implementing many financial indicators, and allowing complex financial charts to be composed easily.

Key Features

Using FinanceChart

To use FinanceChart, the first step is to create an instance of FinanceChart. Next, you may add data to it using setData. After that, you may add the main chart (addMainChart) and other indicator charts to display the data graphically. These charts may be added in any order.

For the main chart, you may:

For indicator charts, FinanceChart includes a wide variety of indicators. Please refer to the table below for details. You may also add your own custom indicator chart using addLineIndicator and addBarIndicator.

In addition to chart building methods, FinanceChart also has a number of chart formatting methods, such as addPlotAreaTitle to add chart title, setPlotAreaStyle to control background color and grid lines, setDateLabelFormat to control date/time formatting, etc.

Furthermore, as FinanceChart is a subclass of MultiChart, and the main and indicator charts are implemented as XYChart objects, they can use the powerful ChartDirector API for formatting (eg. background images, custom logos, custom text boxes, metallic colors, etc).

FinanceChart Methods

MethodInheritedDescription
FinanceChart(Self)Creates a new FinanceChart object.
enableAntiAlias(Self)Enables/Disables anti-alias.
setMargins(Self)Sets the margins around the plot area.
addPlotAreaTitle(Self)Adds a text title above the plot area. You may add multiple title above the plot area by calling this method multiple times.
setPlotAreaStyle(Self)Sets the plot area style. The default is to use very pale yellow FFFFF0 as background, and light grey DDDDDD for the grid lines.
setLegendStyle(Self)Sets legend style. The default is using Arial 8 pt black color as font on a semi-transparent pale blue 80CCCCFF background.
setXAxisStyle(Self)Sets x-axis label style. The default is Arial 8 pt black color as font with no text rotation.
setYAxisStyle(Self)Sets y-axis label style. The default is Arial 8 pt black color, with 13 pixels margin.
setAxisOnRight(Self)Sets whether the main y-axis is on right of left side of the plot area. The default is on right.
setLogScale(Self)Determines if log scale should be used for the main chart. The default is to use linear scale.
setDateLabelFormat(Self)Sets the date/time formats to use for the x-axis labels under various cases.
setDateLabelSpacing(Self)Sets the minimum label spacing between two labels on the time axis.
setToolTipDateFormat(Self)Sets the date/time formats to use for the tool tips under various cases.
getToolTipDateFormat(Self)Gets the date/time format string to use for tool tips.
setNumberLabelFormat(Self)Sets the number format to use.
setData(Self)Sets the data to be used in the chart.
addMainChart(Self)Adds the main chart - the chart that shows the data for the prices.
addCandleStick(Self)Adds a candlestick layer to the main chart.
addHLOC(Self)Adds a HLOC layer to the main chart.
addCloseLine(Self)Adds a closing price line on the main chart.
addWeightedClose(Self)Adds a weighted close line on the main chart.
addTypicalPrice(Self)Adds a typical price line on the main chart.
addMedianPrice(Self)Adds a median price line on the main chart.
addSimpleMovingAvg(Self)Adds a simple moving average line on the main chart.
addExpMovingAvg(Self)Adds an exponential moving average line on the main chart.
addTriMovingAvg(Self)Adds a triangular moving average line on the main chart.
addWeightedMovingAvg(Self)Adds a weighted moving average line on the main chart.
addBand(Self)Adds a generic band to the main finance chart. This method is used internally by other methods to add various bands (eg. Bollinger band, Donchian channels, etc).
addBollingerBand(Self)Adds a Bollinger band on the main chart.
addDonchianChannel(Self)Adds a Donchian channel on the main chart.
addEnvelop(Self)Adds a price envelop on the main chart. The price envelop is a defined as a ratio around a moving average. For example, a ratio of 0.2 means 20% above and below the moving average.
addVolBars(Self)Adds a volume bar chart layer on the main chart.
addIndicator(Self)Adds a blank indicator chart to the finance chart. Used internally to add other indicators. Override to change the default formatting (eg. axis fonts, etc.) of the various indicators.
addLineIndicator(Self)Adds a generic line indicator chart.
addLineIndicator2(Self)Adds a line to an existing indicator chart.
addBarIndicator(Self)Adds a generic bar indicator chart.
addBarIndicator2(Self)Adds a bar layer to an existing indicator chart.
addThreshold(Self)Adds an upper/lower threshold range to an existing indicator chart.
addAccDist(Self)Adds an Accumulation/Distribution indicator chart.
addAroon(Self)Adds an Aroon Up/Down indicators chart.
addAroonOsc(Self)Adds an Aroon Oscillator indicator chart.
addADX(Self)Adds an Average Directional Index indicators chart.
addATR(Self)Adds an Average True Range indicators chart.
addBollingerWidth(Self)Adds a Bollinger Band Width indicator chart.
addCCI(Self)Adds a Community Channel Index indicator chart.
addChaikinMoneyFlow(Self)Adds a Chaikin Money Flow indicator chart.
addChaikinOscillator(Self)Adds a Chaikin Oscillator indicator chart.
addChaikinVolatility(Self)Adds a Chaikin Volatility indicator chart.
addCLV(Self)Adds a Close Location Value indicator chart.
addDPO(Self)Adds a Detrended Price Oscillator indicator chart.
addDonchianWidth(Self)Adds a Donchian Channel Width indicator chart.
addEaseOfMovement(Self)Adds a Ease of Movement indicator chart.
addFastStochastic(Self)Adds a Fast Stochastic indicator chart.
addMACD(Self)Adds a MACD indicator chart.
addMassIndex(Self)Adds a Mass Index indicator chart.
addMFI(Self)Adds a Money Flow Index indicator chart.
addMomentum(Self)Adds a Momentum indicator chart.
addNVI(Self)Adds a Negative Volume Index indicator chart.
addOBV(Self)Adds an On Balance Volume indicator chart.
addPerformance(Self)Adds a Performance indicator chart.
addPPO(Self)Adds a Percentage Price Oscillator indicator chart.
addPVI(Self)Adds a Positive Volume Index indicator chart.
addPVO(Self)Adds a Percentage Volume Oscillator indicator chart.
addPVT(Self)Adds a Price Volume Trend indicator chart.
addROC(Self)Adds a Rate of Change indicator chart.
addRSI(Self)Adds a Relative Strength Index indicator chart.
addSlowStochastic(Self)Adds a Slow Stochastic indicator chart.
addStdDev(Self)Adds a Moving Standard Deviation indicator chart.
addStochRSI(Self)Adds a Stochastic RSI indicator chart.
addTRIX(Self)Adds a TRIX indicator chart.
addUltimateOscillator(Self)Adds an Ultimate Oscillator indicator chart.
addVolIndicator(Self)Adds a Volume indicator chart.
addWilliamR(Self)Adds a William %R indicator chart.
MultiChartMultiChartCreates a new MultiChart object.
addChartMultiChartAdds a BaseChart object (or its subclass such as PieChart, XYChart, PolarChart, AngularMeter or LinearMeter) into the multi-chart.
setMainChartMultiChartSets the chart that receives view port mouse actions (for zooming and scrolling support).
setSizeBaseChartSets the size of the chart.
setBackgroundBaseChartSets the background color, border color and 3D border effect of the chart.
setRoundedFrameBaseChartSets the border style of the chart to rounded corners.
setBorderBaseChartSets the border color of the chart.
setWallpaperBaseChartUses the image from the specified file as the wallpaper to repetitively fill the background of the chart.
setBgImageBaseChartUses the image from the specified file as the background image of the chart.
setSearchPathBaseChartSets the search path for loading image files.
setTransparentColorBaseChartSpecifies a certain color to mean transparent when creating the image output, or to include alpha transparency channel in the output.
setAntiAliasBaseChartControls whether anti-alias is used when drawing lines, shapes and text.
addTitleBaseChartAdds a title at the top center of the chart.
addTitle2BaseChartAdds a title to the chart.
addLegendBaseChartAdds a legend box to the chart.
addLegend2BaseChartAdds a legend box to the chart with grid layout.
getLegendBaseChartGets the LegendBox object representing the legend box in the chart.
layoutLegendBaseChartLays out and gets the LegendBox object representing the legend box in the chart.
getDrawAreaBaseChartRetrieves the internal DrawArea object that is used to draw the chart.
addTextBaseChartAdds a text box to the chart.
addLineBaseChartAdds a line to the chart.
addExtraFieldBaseChartAdds an array of text to be used as an extra field in various places.
addExtraField2BaseChartAdds an array of numbers/dates to be used as an extra field in various places.
setColorBaseChartChange the color at the specified position in the palette.
setColorsBaseChartChange the colors in the palette.
setColors2BaseChartChange the colors in the palette, starting from the specified position in the palette.
getColorBaseChartGets the color at the specified position of the palette.
halfColorBaseChartCreates a color that is half the intensity of the given color.
dashLineColorBaseChartCreates a dash line color.
patternColorBaseChartCreates a pattern color using an array of colors as the bitmap pattern.
patternColor2BaseChartCreates a pattern color by loading the pattern from an image file.
linearGradientColorBaseChartCreates a two-point linear gradient color.
linearGradientColor2BaseChartCreates a multi-point linear gradient color.
radialGradientColorBaseChartCreates a two-point radial gradient color.
radialGradientColor2BaseChartCreates a multi-point radial gradient color.
gradientColorBaseChartCreates a two-point linear gradient color.
gradientColor2BaseChartCreates a multi-point linear gradient color.
setDefaultFontsBaseChartSets the defaults for normal, bold, italic and bold-italic fonts.
setFontTableBaseChartSets an entry in the font table to the specified font name.
formatValueBaseChartFormats a number/date using the ChartDirector formatting syntax as is in Parameter Substitution and Formatting.
setNumberFormatBaseChartSets the characters used for thousand separator, decimal point, and negative sign.
setMonthNamesBaseChartSets the names of the months for date/time formatting purposes.
setWeekDayNamesBaseChartSets the names of the week days for date/time formatting purposes.
setAMPMBaseChartSets the names to be used to denote morning and afternoon.
layoutBaseChartPerform auto-scaling of the axis and compute the positions of the various objects in the chart.
makeChartBaseChartGenerates the chart image and save it into a file.
makeChart2BaseChartGenerates the chart as an image in memory.
makeChart3BaseChartGenerates the chart in internal format and return a DrawArea object to allow adding custom drawings on top of the chart.
makeSessionBaseChartGenerates the chart as an image and save it to a session variable.
makeTmpFileBaseChartGenerates the chart as an image and save it to a temporary file, and automatically remove old files.
getHTMLImageMapBaseChartGenerates an HTML image map for the chart.
getChartMetricsBaseChartGets the chart metrics for passing to WebChartViewer.setChartMetrics to support view ports.