@Html.Highcharts4Net().AreaChart(settings =>
{
settings.SetTitle(s => s.Text = "Historic and Estimated Worldwide Population Growth by Region");
settings.SetSubtitle(s => s.Text = "Source: Wikipedia.org");
settings.AddXAxis(s =>
{
s.Categories = new[]
{
"1750", "1800", "1850", "1900", "1950", "1999", "2050"
};
s.TickmarkPlacement = Placement.On;
s.Title = new XAxisTitle
{
Enabled = false
};
});
settings.AddYAxis(s =>
{
s.Title = new YAxisTitle
{
Text = "Billions"
};
s.Labels = new YAxisLabels
{
Formatter = @"function () { return this.value / 1000; }"
};
});
settings.SetTooltip(s =>
{
s.Shared = true;
s.ValueSuffix = " millions";
});
settings.SetPlotOptions(s =>
{
s.Area = new PlotOptionsArea
{
Stacking = Stackings.Normal,
LineColor = Color.FromArgb(100, 102, 102, 102).ToHexString(),
LineWidth = 1,
Marker = new PlotOptionsAreaMarker
{
LineWidth = 1,
LineColor = Color.FromArgb(100, 102, 102, 102).ToHexString()
}
};
});
settings.AddSeries(s =>
{
s.Name = "Asia";
s.Data = new Data(new HighchartsDataPoint?[]
{
502,635,809,947,1402,3634,5268
});
});
settings.AddSeries(s =>
{
s.Name = "Africa";
s.Data = new Data(new HighchartsDataPoint?[]
{
106,107,111,133,221,767,1766
});
});
settings.AddSeries(s =>
{
s.Name = "Europe";
s.Data = new Data(new HighchartsDataPoint?[]
{
163,203,276,408,547,729,628
});
});
settings.AddSeries(s =>
{
s.Name = "America";
s.Data = new Data(new HighchartsDataPoint?[]
{
18,31,54,156,339,818,1201
});
});
settings.AddSeries(s =>
{
s.Name = "Oceania";
s.Data = new Data(new HighchartsDataPoint?[]
{
2,2,2,6,13,30,46
});
}
);
}).Render()