@Html.Highcharts4Net().SplineChart(settings =>
{
settings.Name = "SplineInverted";
settings.SetChart(s => { s.Inverted = true; });
settings.SetTitle(s => { s.Text = "Atmosphere Temperature by Altitude"; });
settings.SetSubtitle(s => { s.Text = "According to the Standard Atmosphere Model"; });
settings.AddXAxis(s =>
{
s.Reversed = true;
s.Title = new XAxisTitle
{
Enabled = true,
Text = "Altitude",
};
s.Labels = new XAxisLabels
{
Formatter = @"function() {
return this.value + 'km';
}"
};
s.MaxPadding = 0.05;
s.ShowLastLabel = true;
});
settings.AddYAxis(s =>
{
s.Title = new YAxisTitle
{
Text = "Temperature"
};
s.Labels = new YAxisLabels
{
Formatter = @"function() {
return this.value + '°';
}"
};
s.LineWidth = 2;
});
settings.SetLegend(s => { s.Enabled = false; });
settings.SetTooltip(s =>
{
s.HeaderFormat = "<b>{series.name}</b><br />";
s.PointFormat = "{point.x} km: {point.y}°C";
});
settings.SetPlotOptions(s =>
{
s.Spline = new PlotOptionsSpline
{
Marker = new PlotOptionsSplineMarker
{
Enabled = false
}
};
});
settings.AddSeries(s =>
{
s.Name = "Temperature";
s.Data = new Data(new Number?[,] {{0, 15}, {10, -50}, {20, -56.5}, {30, -46.5}, {40, -22.1}, {50, -2.5}, {60, -27.7}, {70, -55.7}, {80, -76.5}});
});
}).Render()