@Html.Highcharts4Net().BarChart(settings =>
{
settings.SetTitle(s => { s.Text = "Stacked bar chart"; });
settings.AddXAxis(s =>
{
s.Categories = new[] { "Apples", "Oranges", "Pears", "Grapes", "Bananas" };
});
settings.AddYAxis(s =>
{
s.Min= 0;
s.Title = new YAxisTitle {
Text = "Total fruit consumption"
};
});
settings.SetPlotOptions(s =>
{
s.Bar = new PlotOptionsBar
{
Stacking = Stackings.Normal
};
});
settings.SetLegend(s =>
{
s.Reversed = true;
});
settings.AddSeries(s =>
{
s.Name = "John";
s.Data = new Data(new HighchartsDataPoint?[] { 5, 3, 4, 7, 2 });
});
settings.AddSeries(s =>
{
s.Name = "Jane";
s.Data = new Data(new HighchartsDataPoint?[] { 2, 2, 3, 2, 1 });
});
settings.AddSeries(s =>
{
s.Name = "Joe";
s.Data = new Data(new HighchartsDataPoint?[] { 3, 4, 4, 2, 5 });
});
}).Render()