Search
StockPriceSeries Constructor (List<StockPrice>)
See Also
 






Initializes a new instance of the StockPriceSeries class.

Namespace: MindFusion.Charting
File: StockPriceSeries.js

 Syntax

JavaScript  Copy Code

function StockPriceSeries (values)

 Parameters

values

Type: List
A list of StockPrice objects.

 Example

The following code creates a new StockPriceSeries with a List of 5 StockPrice objects:

JavaScript  Copy Code

var stockData = [
    [15.99, 16.07, 15.80, 15.94],
    [15.93, 16.03, 15.89, 15.97],
    [15.97, 16.43, 15.94, 16.40],
    [16.36, 16.52, 16.34, 16.46],
    [16.44, 16.47, 16.23, 16.38]
  
   
];

// create sample data
var dataList = new Collections.List();
for (var i = 0; i < 5; i++)
{
 var date = new Date(new Date().getFullYear(), new Date().getMonth());
        var dataItem = new Charting.StockPrice(stockData[i][0], stockData[i][3], stockData[i][2], stockData[i][1], new Date(date.setDate(1 + i)));
 dataList.add(dataItem);
}

var series = new StockPriceSeries(dataList);

 See Also