jqwidgets-framework
Version:
jQWidgets is an advanced Angular, Vue, Blazor, React, Web Components, jquery, ASP .NET MVC, Custom Elements and HTML5 UI framework.
105 lines (100 loc) • 4.83 kB
HTML
<html ng-app="demoApp" lang="en">
<head>
<title id='Description'>AngularJS Chart Spline Series Example</title>
<meta name="description" content="This is an example of AngularJS Chart. Chart Spline Series." />
<link rel="stylesheet" type="text/css" href="../../../jqwidgets/styles/jqx.base.css" />
<script type="text/javascript" src="../../../scripts/angular.min.js"></script> <script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxdraw.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxchart.core.js"></script><script type="text/javascript" src="../../../jqwidgets/jqxangular.js"></script>
<script type="text/javascript">
var demoApp = angular.module("demoApp", ["jqwidgets"]);
demoApp.controller("demoController", function ($scope) {
// prepare the data
var source =
{
datatype: "tab",
datafields: [
{ name: 'Year' },
{ name: 'HPI' },
{ name: 'BuildCost' },
{ name: 'Population' },
{ name: 'Rate' }
],
url: '../../sampledata/homeprices.txt'
};
var dataAdapter = new $.jqx.dataAdapter(source, { async: false, autoBind: true, loadError: function (xhr, status, error) { alert('Error loading "' + source.url + '" : ' + error); } });
// prepare jqxChart settings
var settings = {
title: "U.S. Historical Home Prices (1950-2011)",
description: "Source: http://www.econ.yale.edu/~shiller/data.htm",
enableAnimations: true,
showLegend: true,
padding: { left: 5, top: 5, right: 25, bottom: 5 },
titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },
source: dataAdapter,
xAxis:
{
dataField: 'Year',
showTickMarks: true,
tickMarksInterval: 1,
tickMarksColor: '#888888',
unitInterval: 5,
showGridLines: true,
gridLinesInterval: 5,
gridLinesColor: '#888888',
//axisSize: 'auto',
minValue: 1947,
maxValue: 2012
},
colorScheme: 'scheme04',
seriesGroups:
[
{
type: 'line',
valueAxis:
{
unitInterval: 10,
description: 'U.S. Population (millions)',
showGridLines: false
},
series: [
{ dataField: 'Population', displayText: 'Population' }
]
},
{
type: 'spline',
valueAxis:
{
unitInterval: 1,
displayValueAxis: false,
displayGridLines: false
},
series: [
{ dataField: 'Rate', displayText: 'Interest Rate' }
]
},
{
type: 'spline',
valueAxis:
{
unitInterval: 20,
description: 'Index Value'
},
series: [
{ dataField: 'HPI', displayText: 'Real Home Price Index' },
{ dataField: 'BuildCost', displayText: 'Building Cost Index' }
]
}
]
};
$scope.chartSettings = settings;
});
</script>
</head>
<body ng-controller="demoController">
<jqx-chart id='chartContainer' jqx-settings="chartSettings" style="width: 850px; height: 500px"></jqx-chart>
</body>
</html>