I'm attempting to add Chart.Mvc controls (Chart.js) to my Asp.net MVC 5 website. However, when I follow the example here: https://github.com/martinobordin/Chart.Mvc
I'm receiving the following error:
CS0426: The type name 'Mvc' does not exist in the type 'System.Web.Helpers.Chart'
It appears the reference I have to Chart.Mvc
is colliding with System.Web.Helpders.Chart
.
I've tried it both with a fully qualified reference and without:
var barChart = new Chart.Mvc.ComplexChart.BarChart();
barChart.ComplexData.Labels.AddRange(new []{ "January", "February", "March", "April", "May", "June", "July"});
barChart.ComplexData.Datasets.AddRange(new List<ComplexDataset>...
and
var barChart = new BarChart();
barChart.ComplexData.Labels.AddRange(new []{ "January", "February", "March", "April", "May", "June", "July"});
barChart.ComplexData.Datasets.AddRange(new List<ComplexDataset>
This second option does throw a slightly different error:
CS0246: The type or namespace name 'BarChart' could not be found (are you missing a using directive or an assembly reference?)
Adding using Chart.Mvc;
to the Controller or @Chart.Mvc
to the View does not help;