I\'m attempting to build a stock chart using Microsoft\'s charting library.
I\'m using this code to create the chart in my view:
@{
System.Web.H
After dealing with the same issue - only being able to add one value to a series - while trying to build a Stacked Column chart with multiple Y axis values - using the Web.Helper.Chart class.
I did not find the one answer anywhere on MSDN or any other forum including StackOverflow. Turns out - it is quite simple: You can add more than one series with the .AddSeries method.
In other words, in plain English, call the .AddSeries method once for each series you want to add to the chart.
This example was used to report daily inventory which is measured in tons, as it would be at a steel plant - production measured in tons of steel in inventory.
new Chart(1000, 500, ChartTheme.Blue)
.AddTitle("Inventory")
.AddSeries(name: "A",
chartType: "StackedColumn",
xValue: intDays,
yValues: dblTons_A)
.AddSeries(name: "B",
chartType: "StackedColumn",
xValue: intDays,
yValues: dblTons_B)
.AddSeries(name: "C",
chartType: "StackedColumn",
xValue: intDays,
yValues: dblTons_C)
.AddSeries(name: "D",
chartType: "StackedColumn",
xValue: intDays,
yValues: dblTons_D)
.Write("png");