This is planned to be a library to wrap the functionality on morris.js for asp.net mvc 5
public ActionResult AssessmentOverTime(List<Foo> foos)
{
LineGraphDTO model = new LineGraphDTO() {
data = foos.Select(foo => new { value = foo.Value, date = foo.date.ToString("yyyy-MM-dd") }).ToList<object>(),
element = "chart",
labels = new List<string> { "Value" },
xkey = "date",
ykeys = new List<string> {"value"},
};
return View(model);
}
<script>
new Morris.Line(@Html.Raw(Model.ToJSON()));
</script>
Currently dependent on http://james.newtonking.com/json