<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- Ignite UI for jQuery Required Combined CSS Files -->
<link href="http://cdn-na.infragistics.com/igniteui/2024.1/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
<link href="http://cdn-na.infragistics.com/igniteui/2024.1/latest/css/structure/infragistics.css" rel="stylesheet" />
<script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
<!-- Ignite UI for jQuery Required Combined JavaScript Files -->
<script src="http://cdn-na.infragistics.com/igniteui/2024.1/latest/js/infragistics.core.js"></script>
<script src="http://cdn-na.infragistics.com/igniteui/2024.1/latest/js/infragistics.dv.js"></script>
</head>
<body>
<div id="sparkline"></div>
<script src="/TypeScriptSamples/sparkline/typescript.js"></script>
</body>
</html>
/// <reference path="/js/typings/jquery.d.ts" />
/// <reference path="/js/typings/jqueryui.d.ts" />
/// <reference path="/js/typings/igniteui.d.ts" />
class SparkElem {
Price: number;
constructor(_price) {
this.Price = _price;
}
}
//Creates an array of generated SparkElem types and that array is used as data for the Sparkline.
function generateArray() {
var generatedArray: SparkElem[] = [];
for (var i = 0; i < 100; i++) {
var generatedNumber;
if (i < 50) {
generatedNumber = (i % 10) * (i % 5) * (i / 5 - 1) * i;
}
else {
generatedNumber = (i % 10) * (i % 5) * (i / 5 - 2) * (100 - i);
}
generatedArray.push(new SparkElem(generatedNumber));
}
return generatedArray;
}
$(function () {
$("#sparkline").igSparkline({
dataSource: generateArray(),
height: "100px",
width: "100%",
valueMemberPath: 'Price',
normalRangeVisibility: "visible",
normalRangeMinimum: 200,
normalRangeMaximum: 600,
trendLineType: "simpleAverage"
});
});