Created
March 14, 2012 17:49
-
-
Save bsatrom/2038193 to your computer and use it in GitHub Desktop.
Example of script for Kendo UI DataViz Gauge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#add').bind('click', function() { | |
var amt, intakeRecord, grid, gauge; | |
amt = parseInt($('#dailyIntake').val()) || 0; | |
intakeRecord = { date: getDate(), amount: amt } | |
intakeData.add(intakeRecord); | |
gauge = $("#srirachaGauge").data("kendoGauge"); | |
gauge.value(avgIntake()); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var srirachaMax = 20; | |
$('#srirachaGauge').kendoGauge({ | |
theme: "blueopal", | |
pointer: { | |
value: avgIntake() | |
}, | |
scale: { | |
majorUnit: 2, | |
minorUnit: .25, | |
startAngle: -30, | |
endAngle: 210, | |
max: srirachaMax, | |
labels: { | |
font: "10px arial, Helvetica, sans-serif", | |
template: "#=value# tsp." | |
}, | |
ranges: [ | |
{ | |
from: 0, | |
to: 10, | |
color: "#00ab00" //green | |
}, { | |
from: 10, | |
to: 16, | |
color: "#d3ce37" //yellow | |
}, { | |
from: 16, | |
to: srirachaMax, | |
color: "#ae130f" //red | |
} | |
] | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment