Thats My Controller-
public ActionResult DashBoard()
{
var user = repository.Get<ApplicationUser>(m => m.UserName == User.Identity.Name);
ViewBag.List = repository.GetMany<TestResult>(m => m.TestInfoID == 3 && m.Username == User.Identity.Name).Select(n => new { TestDate = n.TestDate.ToString("yyyy-MM-dd"), BMI = Converter.CalculateBMI(user.Weight, true, user.Height, true).ToString("#.##"), BodyFat = Convert.ToDouble(n.Result).ToString("#.##"), FatWeight = Converter.CalculateFatWeight(user.Weight, Convert.ToDouble(n.Result)).ToString("#.##"), MuscleWeight = Converter.CalculateMuscleMass(user.Weight, Convert.ToDouble(n.Result)).ToString("#.##") });
return View();
}
ITs MY VIew=
<script>
$(function () {
var jsondata= @Html.Raw(Json.Encode(ViewBag.list))
$('#container').highcharts({
chart: {
type: 'gauge',
alignticks: false,
plotbackgroundcolor: null,
plotbackgroundimage: null,
plotborderwidth: 0,
plotshadow: false
},
title: {
text: 'speedometer with dual axes'
},
pane: {
startangle: -150,
endangle: 150
},
yaxis: [{
min: 0,
max: 200,
linecolor: '#339',
tickcolor: '#339',
minortickcolor: '#339',
offset: -25,
linewidth: 2,
labels: {
distance: -20,
rotation: 'auto'
},
ticklength: 5,
minorticklength: 5,
endontick: false
}],
series: [{
name: 'speed',
data: __________________,
datalabels: {
formatter: function () {
var kmh = this.y;
return '<span style="color:#339">'+ kmh + ' kg</span><br/>' ;
},
backgroundcolor: {
lineargradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, '#ddd'],
[1, '#fff']
]
}
},
tooltip: {
valuesuffix: ' km/h'
}
}]
},
function(chart) {
setinterval(function () {
var point = chart.series[0].points[0],
newval, inc = math.round((math.random() - 0.5) * 20);
newval = point.y + inc;
if (newval < 0 || newval > 200) {
newval = point.y - inc;
}
point.update(newval);
}, 3000);
});
});