MindFusion.Charting for JavaScript Programmer's Guide
DateTimeSeries Constructor
See Also
 






Initializes a new instance of the DateTimeSeries class.

Namespace: MindFusion.Charting
File: DateTimeSeries.js

 Syntax

JavaScript  Copy Code

function DateTimeSeries (dates, values, minDate, maxDate)

 Parameters

dates

Type: List
A list of Date values.

values

Type: List
A list of number values.

minDate

Type: Date
Identifies the start of the time range.

maxDate

Type: Date
Identifies the end of the time range.

 Example

The following code creates a new DateTimeSeries that uses the last 10 years as Date values and a List with income data. The first and last Date in the list are used as min and max values.

JavaScript  Copy Code

// create sample series
var years = new Collections.List();
var dt = new Date(new Date().getFullYear() - 10, 11, 31);
for (; ;)
{
 if (dt.getFullYear() > new Date().getFullYear())
  break;
 years.add(new Date(dt.setFullYear(dt.getFullYear() + 1)));
}

var income = new Collections.List([12, 13.2, 15.6, 17.8, 39, 20, 29, 79, 101, 120, 122]);

var series = new DateTimeSeries(
 years, income, years.item(0), years.item(years.count() - 1));

 See Also

DateTimeSeries Constructor Overload List
DateTimeSeries Class
MindFusion.Charting Namespace