JavaScript
$(document).ready(function () {
// prepare chart data
var sampleData = [
{ Day:0, Keith:30, Erica:15, George: 25, Tom: 45, John: 05, Mark: 10},
{ Day:1, Keith:25, Erica:25, George: 30, Tom: 40, John: 15, Mark: 15},
{ Day:2, Keith:30, Erica:20, George: 25, Tom: 55, John: 35, Mark: 20},
{ Day:3, Keith:35, Erica:25, George: 45, Tom: 50, John: 10, Mark: 90},
{ Day:4, Keith:20, Erica:20, George: 25, Tom: 15, John: 45, Mark: 50},
{ Day:5, Keith:30, Erica:20, George: 30, Tom: 85, John: 25, Mark: 35},
{ Day:6, Keith:60, Erica:45, George: 90, Tom: 95, John: 35, Mark: 40}
];
// prepare jqxChart settings
var settings = {
title: "Fitness & exercise weekly scorecard",
description: "Time spent in vigorous exercise",
padding: { left: 5, top: 5, right: 5, bottom: 5 },
titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },
source: sampleData,
xAxis:
{
dataField: 'Day',
formatFunction: function (value, itemIndex, serie, group) {
// value is from 0-6 (see 'Day' field in sampleData above)
var days =
['Monday', 'Tuesday', 'Wednesday',
'Thursday', 'Friday', 'Saturday', 'Sunday'];
return days[value];
},
valuesOnTicks: false
},
valueAxis:
{
minValue: 0,
maxValue: 100,
unitInterval: 10,
title: {text: 'Time in minutes'},
labels:
{
horizontalAlignment:...