I want to use the System.Web.Helpers.Chart
in my project. I simply tried the example from the docs:
https://learn.microsoft.com/en-us/aspnet/web-pages/overview/data/7-displaying-data-in-a-chart
var myChart = new Chart(width: 600, height: 400)
.AddTitle("Chart Title")
.AddSeries(
name: "Employee",
xValue: new[] { "Peter", "Andrew", "Julie", "Mary", "Dave" },
yValues: new[] { "2", "6", "4", "5", "3" });
But when I run my code I get the following error:
System.ArgumentNullException: 'Value cannot be null. Parameter name: httpContext'
My code is inside a DLL, not an MVC or WebAPI project. So I guess it lacks a HttpContext for that reason.
Is there still a way to use this Chart
library from my DLL project?