Hello,
I'm a newbie to webstuff overall. I followed the things listed under QuickStart guide.
This is how my View looks like:
`@model WebProto.Models.Movie
@using Chart.Mvc.ComplexChart;
@using Chart.Mvc.Extensions;
@{
ViewBag.Title = "Movie-Chart";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@Model.Name
@{
var barChart = new BarChart();
barChart.ComplexData.Labels.AddRange(new[] { "January", "February", "March", "April", "May", "June", "July" });
barChart.ComplexData.Datasets.AddRange(new List
{
new ComplexDataset
{
Data = new List { 65, 59, 80, 81, 56, 55, 40 },
Label = "My First dataset",
FillColor = "rgba(220,220,220,0.2)",
StrokeColor = "rgba(220,220,220,1)",
PointColor = "rgba(220,220,220,1)",
PointStrokeColor = "#fff",
PointHighlightFill = "#fff",
PointHighlightStroke = "rgba(220,220,220,1)",
},
new ComplexDataset
{
Data = new List { 28, 48, 40, 19, 86, 27, 90 },
Label = "My Second dataset",
FillColor = "rgba(151,187,205,0.2)",
StrokeColor = "rgba(151,187,205,1)",
PointColor = "rgba(151,187,205,1)",
PointStrokeColor = "#fff",
PointHighlightFill = "#fff",
PointHighlightStroke = "rgba(151,187,205,1)",
}
});
}
@Html.CreateChart("myCanvas", barChart)`
When the very last line of it is executed I get Runtime Error in JavaScript "Chart" is undefined.
It then shows me this dynamic dump of the generated file And it marks the last line of this:
var myCanvas_chart = new Chart(ctx).Bar(data, options)
How do I add the correct reference to the generated javascript block?