bindingInfo.setStockBindingField(arr)

bindingInfo.xFields

bindingInfo.yFields

bindingInfo.breakdownFields

bindingInfo.geoFields

bindingInfo.setMapLayer(col,layer)

bindingInfo.getMapLayer(col)

bindingInfo.getGroupOrder(col,binding)

bindingInfo.setGroupOrder(col,grouping)

bindingInfo.isTimeSeries(col)

bindingInfo.setTimeSeries(col,boolean)

bindingInfo.getColumnOrder(col)

bindingInfo.setColumnOrder(col,order)

bindingInfo.getTopN(col)

bindingInfo.setTopN(col,N)

bindingInfo.isTopNReverse(col)

bindingInfo.setTopNReverse(col,boolean)

bindingInfo.getTopNSummaryCol(col)

bindingInfo.setTopNSummaryCol(col,agg)

bindingInfo.getFormula(col,binding)

bindingInfo.setFormula(col, formula, binding)

bindingInfo.getPercentageType(col,binding)

bindingInfo.setPercentageType(col,type)

bindingInfo.getSecondaryField(col, binding)

bindingInfo.setSecondaryField(col1, col2, binding)

bindingInfo.getColorField()

bindingInfo.setColorField(col, type)

bindingInfo.getShapeField()

bindingInfo.setShapeField(col, type)

bindingInfo.getSizeField()

bindingInfo.setSizeField(col, type)

bindingInfo.getTextField()

bindingInfo.setTextField(col, type)

bindingInfo.setCandleBindingField(arr)

bindingInfo.getCandleBindingField(measure)

bindingInfo.setStockBindingField(arr)

bindingInfo.getStockBindingField(measure)

bindingInfo.colorFrame

bindingInfo.shapeFrame

bindingInfo.sizeFrame

bindingInfo.textureFrame

bindingInfo.lineFrame

bindingInfo.colors

bindingInfo.shapes

bindingInfo.size

bindingInfo.textures

bindingInfo.lines

bindingInfo.addMapping(col, value, geocode)

bindingInfo.getMappings(col)

bindingInfo.removeMapping(col,value)

Configure the binding for a stock-type chart, also known as an open-hi-low-close (OHLC) chart. A stock chart displays four different measures, “low,” “high,” “opening,” and “closing,” and is most often used to plot trading information. The parameter arr contains information for plotting one of these four measures.

Parameter

arr Array of properties for a stock chart measure:

[field1,measure,formula,option,field2]

The items in the array are described below:

field1 Field containing data coresponding to measure.

measure The measure represented by field1:

Chart.HIGH: field1 defines the high values

Chart.LOW: field1 defines the low values

Chart.OPEN: field1 defines the opening values

Chart.CLOSE: field1 defines the closing values

formula A Chart Constants summarization formula

(See Summarization Formulas.)

option Specifies how percentages should be computed:

Chart.PERCENTAGE_NONE

Chart.PERCENTAGE_OF_GRANDTOTAL

Chart.PERCENTAGE_OF_GROUP

field2 The second operand for a bivariate formula (e.g., correlation).

The first two items in the array (field1, measure) are required. The others are optional.

Example

To create a stock chart that displays the average high, low, opening, and closing prices by quarter, follow the steps below:

1. Create a new report or Viewsheet. For a Viewsheet, select the 'Stock History' > 'Stock Prices' query as the data source.

2. Add a new Chart element to the report or Viewsheet.

3. Enter the following script in the onLoad handler of the report or Viewsheet. (Note the slightly different syntax in the first two lines for report and Viewsheet.)

// For a report:

Chart1.query='Stock Prices';

 

// For a Viewsheet:

Chart1.data='Stock Prices';

 

Chart1.separatedStyle=Chart.CHART_STOCK;

var data_high = ["Stock Prices.High",Chart.HIGH,Chart.AVERAGE_FORMULA];

var data_low = ["Stock Prices.Low",Chart.LOW,Chart.AVERAGE_FORMULA];

var data_close = ['Stock Prices.Close/Last',Chart.CLOSE,Chart.AVERAGE_FORMULA];

var data_open = ['Stock Prices.Open',Chart.OPEN,Chart.AVERAGE_FORMULA];

 

Chart1.bindingInfo.xFields=[['Date',Chart.DATE]];

Chart1.bindingInfo.setGroupOrder('Date',Chart.QUARTER_INTERVAL);

Chart1.bindingInfo.setStockBindingField(data_high);

Chart1.bindingInfo.setStockBindingField(data_low);

Chart1.bindingInfo.setStockBindingField(data_close);

Chart1.bindingInfo.setStockBindingField(data_open);

4. Preview the chart.

 

In a Viewsheet, you can also use the 'Zoom' tool to limit the date range.

5. To observe the structure of the chart more closely, set a condition on the chart to limit the date range (e.g., limit to the year of 2004).

 

Note that for each quarter, the values of each of the measures (High, Low, Close/Last, Open) have been independently aggregated as specified by the corresponding formula parameter (in this case, Chart.AVERAGE_FORMULA for each).

The “high” and “low” measures are represented by the extremes of the vertical line, and the “open” and “close” measures are represented, respectively, by the left and right horizontal lines.

See Also

bindingInfo.getStockBindingField(measure), to obtain current binding information.

<< bindingInfo.getCandleBindingField(measure) © 1996-2013 InetSoft Technology Corporation (v11.4) bindingInfo.getStockBindingField(measure) >>