Example of Scatter Chart in ASP.NET MVC Charts Control
This Scatter Plot Chart example compares the shoulder and chest measurements for different age groups using the default scatter series.
@* The chart's settings are in the view; the data they read (ViewData) is set in the controller action (see the controller tab). *@
@Html.UiChart(new UiChartOptions
{
Id = "scatterChart",
Tooltip = new UiChartTooltip { Enable = true },
Legend = new UiChartLegend { Visible = true, EnableHighlight = true },
PrimaryXAxis = new UiChartAxis { Title = "Shoulder Breadth (cm)", Minimum = 40, Maximum = 56, ShowGridLines = false, ValueType = UiChartValueType.Double },
PrimaryYAxis = new UiChartAxis { Title = "Bust Chest Circumference (cm)", Minimum = 70, Maximum = 140, Interval = 10 },
Series = new List<UiChartSeries>
{
new UiChartSeries { Type = UiChartSeriesType.Scatter, Width = 2, XName = "Breadth", YName = "Circumference", Name = "18-20 Years", Data = (IEnumerable<object>)ViewData["Cluster1Value"], Marker = new UiChartMarker { Width = 10, Height = 10, Shape = UiChartMarkerShape.Circle } },
new UiChartSeries { Type = UiChartSeriesType.Scatter, Width = 2, XName = "Breadth", YName = "Circumference", Name = "21-25 Years", Data = (IEnumerable<object>)ViewData["Cluster2Value"], Marker = new UiChartMarker { Width = 10, Height = 10, Shape = UiChartMarkerShape.Circle } },
new UiChartSeries { Type = UiChartSeriesType.Scatter, Width = 2, XName = "Breadth", YName = "Circumference", Name = "26-30 Years", Data = (IEnumerable<object>)ViewData["Cluster3Value"], Marker = new UiChartMarker { Width = 10, Height = 10, Shape = UiChartMarkerShape.Circle } },
new UiChartSeries { Type = UiChartSeriesType.Scatter, Width = 2, XName = "Breadth", YName = "Circumference", Name = "31-35 years", Data = (IEnumerable<object>)ViewData["Cluster4Value"], Marker = new UiChartMarker { Width = 10, Height = 10, Shape = UiChartMarkerShape.Circle } },
new UiChartSeries { Type = UiChartSeriesType.Scatter, Width = 2, XName = "Breadth", YName = "Circumference", Name = "36+ Years", Data = (IEnumerable<object>)ViewData["Cluster5Value"], Marker = new UiChartMarker { Width = 10, Height = 10, Shape = UiChartMarkerShape.Circle } }
}
})
@Html.UiChart(new UiChartOptions
{
Id = "scatterChart",
Tooltip = new UiChartTooltip { Enable = true },
Legend = new UiChartLegend { Visible = true, EnableHighlight = true },
PrimaryXAxis = new UiChartAxis { Title = "Shoulder Breadth (cm)", Minimum = 40, Maximum = 56, ShowGridLines = false, ValueType = UiChartValueType.Double },
PrimaryYAxis = new UiChartAxis { Title = "Bust Chest Circumference (cm)", Minimum = 70, Maximum = 140, Interval = 10 },
Series = new List<UiChartSeries>
{
new UiChartSeries { Type = UiChartSeriesType.Scatter, Width = 2, XName = "Breadth", YName = "Circumference", Name = "18-20 Years", Data = (IEnumerable<object>)ViewData["Cluster1Value"], Marker = new UiChartMarker { Width = 10, Height = 10, Shape = UiChartMarkerShape.Circle } },
new UiChartSeries { Type = UiChartSeriesType.Scatter, Width = 2, XName = "Breadth", YName = "Circumference", Name = "21-25 Years", Data = (IEnumerable<object>)ViewData["Cluster2Value"], Marker = new UiChartMarker { Width = 10, Height = 10, Shape = UiChartMarkerShape.Circle } },
new UiChartSeries { Type = UiChartSeriesType.Scatter, Width = 2, XName = "Breadth", YName = "Circumference", Name = "26-30 Years", Data = (IEnumerable<object>)ViewData["Cluster3Value"], Marker = new UiChartMarker { Width = 10, Height = 10, Shape = UiChartMarkerShape.Circle } },
new UiChartSeries { Type = UiChartSeriesType.Scatter, Width = 2, XName = "Breadth", YName = "Circumference", Name = "31-35 years", Data = (IEnumerable<object>)ViewData["Cluster4Value"], Marker = new UiChartMarker { Width = 10, Height = 10, Shape = UiChartMarkerShape.Circle } },
new UiChartSeries { Type = UiChartSeriesType.Scatter, Width = 2, XName = "Breadth", YName = "Circumference", Name = "36+ Years", Data = (IEnumerable<object>)ViewData["Cluster5Value"], Marker = new UiChartMarker { Width = 10, Height = 10, Shape = UiChartMarkerShape.Circle } }
}
})
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Lumen.UI.Mvc;
namespace YourApp.Controllers
{
public class ChartController : Controller
{
// The page is Views/Chart/ScatterChart.cshtml; it draws what ViewData holds.
public ActionResult ScatterChart()
{
List<ScatterPlotChartData> Cluster1Value = new List<ScatterPlotChartData>
{
new ScatterPlotChartData { Breadth = 41.3, Circumference = 78.1 },
new ScatterPlotChartData { Breadth = 41.3, Circumference = 78.04 },
new ScatterPlotChartData { Breadth = 42.9, Circumference = 78.9 },
new ScatterPlotChartData { Breadth = 42.4, Circumference = 80.4 },
new ScatterPlotChartData { Breadth = 42.3, Circumference = 81.7 },
new ScatterPlotChartData { Breadth = 42.1, Circumference = 83.9 },
new ScatterPlotChartData { Breadth = 41.9, Circumference = 82.9 },
new ScatterPlotChartData { Breadth = 41.6, Circumference = 84.6 },
new ScatterPlotChartData { Breadth = 41.6, Circumference = 84.6 },
new ScatterPlotChartData { Breadth = 41.5, Circumference = 85.1 },
new ScatterPlotChartData { Breadth = 41.5, Circumference = 84.3 },
new ScatterPlotChartData { Breadth = 41.5, Circumference = 84.3 },
new ScatterPlotChartData { Breadth = 41.9, Circumference = 87.9 },
new ScatterPlotChartData { Breadth = 42.6, Circumference = 84.0 },
new ScatterPlotChartData { Breadth = 42.6, Circumference = 84.0 },
new ScatterPlotChartData { Breadth = 42.9, Circumference = 84.9 },
new ScatterPlotChartData { Breadth = 42.9, Circumference = 84.9 },
new ScatterPlotChartData { Breadth = 43.4, Circumference = 85.8 },
new ScatterPlotChartData { Breadth = 43.1, Circumference = 83.5 },
new ScatterPlotChartData { Breadth = 42.9, Circumference = 82.2 },
new ScatterPlotChartData { Breadth = 43.2, Circumference = 81.7 },
new ScatterPlotChartData { Breadth = 43.5, Circumference = 82.8 },
new ScatterPlotChartData { Breadth = 43.7, Circumference = 82.7 },
new ScatterPlotChartData { Breadth = 43.5, Circumference = 81.3 },
new ScatterPlotChartData { Breadth = 43.7, Circumference = 80.9 },
new ScatterPlotChartData { Breadth = 43.7, Circumference = 80.9 },
new ScatterPlotChartData { Breadth = 43.5, Circumference = 89.4 },
new ScatterPlotChartData { Breadth = 43.5, Circumference = 79.4 },
new ScatterPlotChartData { Breadth = 43.7, Circumference = 89.0 },
new ScatterPlotChartData { Breadth = 43.5, Circumference = 88.4 },
new ScatterPlotChartData { Breadth = 43.5, Circumference = 88.4 },
new ScatterPlotChartData { Breadth = 43.4, Circumference = 89.4 },
new ScatterPlotChartData { Breadth = 43.0, Circumference = 91.5 },
new ScatterPlotChartData { Breadth = 42.6, Circumference = 87.9 },
new ScatterPlotChartData { Breadth = 42.9, Circumference = 88.4 },
new ScatterPlotChartData { Breadth = 42.9, Circumference = 86.8 },
new ScatterPlotChartData { Breadth = 42.9, Circumference = 86.8 },
new ScatterPlotChartData { Breadth = 43.1, Circumference = 88.5 },
new ScatterPlotChartData { Breadth = 44.2, Circumference = 84.7 },
new ScatterPlotChartData { Breadth = 44.2, Circumference = 84.7 },
new ScatterPlotChartData { Breadth = 44.1, Circumference = 88.6 },
new ScatterPlotChartData { Breadth = 44.1, Circumference = 88.6 },
new ScatterPlotChartData { Breadth = 43.9, Circumference = 87.6 },
new ScatterPlotChartData { Breadth = 44.0, Circumference = 86.6 },
new ScatterPlotChartData { Breadth = 44.3, Circumference = 86.5 },
new ScatterPlotChartData { Breadth = 44.3, Circumference = 86.59 },
new ScatterPlotChartData { Breadth = 44.5, Circumference = 86.9 },
new ScatterPlotChartData { Breadth = 44.5, Circumference = 85.5 },
new ScatterPlotChartData { Breadth = 44.8, Circumference = 85.8 },
new ScatterPlotChartData { Breadth = 45.0, Circumference = 84.6 },
new ScatterPlotChartData { Breadth = 45.0, Circumference = 84.64 },
new ScatterPlotChartData { Breadth = 44.9, Circumference = 82.7 },
new ScatterPlotChartData { Breadth = 44.8, Circumference = 83.7 },
new ScatterPlotChartData { Breadth = 44.89, Circumference = 83.75 },
new ScatterPlotChartData { Breadth = 44.6, Circumference = 83.3 },
new ScatterPlotChartData { Breadth = 44.65, Circumference = 83.37 },
new ScatterPlotChartData { Breadth = 44.65, Circumference = 84.5 },
new ScatterPlotChartData { Breadth = 44.65, Circumference = 84.53 },
new ScatterPlotChartData { Breadth = 44.2, Circumference = 81.8 },
new ScatterPlotChartData { Breadth = 44.9, Circumference = 80.2 },
new ScatterPlotChartData { Breadth = 45.1, Circumference = 85.5 },
new ScatterPlotChartData { Breadth = 44.7, Circumference = 87.1 },
new ScatterPlotChartData { Breadth = 44.70, Circumference = 87.10 },
new ScatterPlotChartData { Breadth = 44.70, Circumference = 87.1 },
new ScatterPlotChartData { Breadth = 44.9, Circumference = 86.8 },
new ScatterPlotChartData { Breadth = 45.1, Circumference = 87.2 },
new ScatterPlotChartData { Breadth = 45.0, Circumference = 88.6 },
new ScatterPlotChartData { Breadth = 45.0, Circumference = 89.4 },
new ScatterPlotChartData { Breadth = 45.0, Circumference = 89.4 },
new ScatterPlotChartData { Breadth = 44.7, Circumference = 88.5 },
new ScatterPlotChartData { Breadth = 44.4, Circumference = 88.3 },
new ScatterPlotChartData { Breadth = 44.4, Circumference = 88.39 },
new ScatterPlotChartData { Breadth = 44.5, Circumference = 89.4 },
new ScatterPlotChartData { Breadth = 44.4, Circumference = 90.0 },
new ScatterPlotChartData { Breadth = 43.9, Circumference = 89.3 },
new ScatterPlotChartData { Breadth = 44.2, Circumference = 90.2 },
new ScatterPlotChartData { Breadth = 44.0, Circumference = 91.2 },
new ScatterPlotChartData { Breadth = 44.0, Circumference = 91.24 },
new ScatterPlotChartData { Breadth = 44.1, Circumference = 88.5 },
new ScatterPlotChartData { Breadth = 44.16, Circumference = 88.53 },
new ScatterPlotChartData { Breadth = 44.16, Circumference = 88.535 },
new ScatterPlotChartData { Breadth = 44.2, Circumference = 91.7 },
new ScatterPlotChartData { Breadth = 44.2, Circumference = 91.75 },
new ScatterPlotChartData { Breadth = 43.9, Circumference = 92.79 },
new ScatterPlotChartData { Breadth = 43.9, Circumference = 92.7 },
new ScatterPlotChartData { Breadth = 44.2, Circumference = 94.8 },
new ScatterPlotChartData { Breadth = 44.0, Circumference = 93.8 },
new ScatterPlotChartData { Breadth = 44.0, Circumference = 93.81 },
new ScatterPlotChartData { Breadth = 44.4, Circumference = 95.6 },
new ScatterPlotChartData { Breadth = 44.8, Circumference = 97.4 },
new ScatterPlotChartData { Breadth = 44.8, Circumference = 93.6 },
new ScatterPlotChartData { Breadth = 44.8, Circumference = 93.67 },
new ScatterPlotChartData { Breadth = 44.6, Circumference = 92.5 },
new ScatterPlotChartData { Breadth = 44.7, Circumference = 94.5 },
new ScatterPlotChartData { Breadth = 45.2, Circumference = 92.2 },
new ScatterPlotChartData { Breadth = 45.2, Circumference = 92.24 },
new ScatterPlotChartData { Breadth = 45.1, Circumference = 94.0 },
new ScatterPlotChartData { Breadth = 45.1, Circumference = 94.0 },
new ScatterPlotChartData { Breadth = 44.9, Circumference = 90.4 },
new ScatterPlotChartData { Breadth = 44.9, Circumference = 89.4 },
new ScatterPlotChartData { Breadth = 44.7, Circumference = 90.4 },
new ScatterPlotChartData { Breadth = 44.7, Circumference = 90.45 },
new ScatterPlotChartData { Breadth = 41.3, Circumference = 78.0 },
new ScatterPlotChartData { Breadth = 42.9, Circumference = 78.9 },
new ScatterPlotChartData { Breadth = 42.4, Circumference = 80.4 },
new ScatterPlotChartData { Breadth = 42.3, Circumference = 81.7 },
new ScatterPlotChartData { Breadth = 42.1, Circumference = 83.9 },
new ScatterPlotChartData { Breadth = 41.9, Circumference = 82.9 },
new ScatterPlotChartData { Breadth = 41.6, Circumference = 84.6 },
new ScatterPlotChartData { Breadth = 41.6, Circumference = 84.60 },
new ScatterPlotChartData { Breadth = 41.5, Circumference = 85.1 },
new ScatterPlotChartData { Breadth = 41.5, Circumference = 84.3 },
new ScatterPlotChartData { Breadth = 41.5, Circumference = 84.34 },
new ScatterPlotChartData { Breadth = 41.9, Circumference = 87.9 },
new ScatterPlotChartData { Breadth = 42.6, Circumference = 84.0 },
new ScatterPlotChartData { Breadth = 42.6, Circumference = 84.0 },
new ScatterPlotChartData { Breadth = 42.9, Circumference = 84.9 },
new ScatterPlotChartData { Breadth = 42.9, Circumference = 84.9 },
new ScatterPlotChartData { Breadth = 43.4, Circumference = 85.8 },
new ScatterPlotChartData { Breadth = 43.1, Circumference = 83.5 },
new ScatterPlotChartData { Breadth = 42.9, Circumference = 82.2 },
new ScatterPlotChartData { Breadth = 43.2, Circumference = 81.7 },
new ScatterPlotChartData { Breadth = 43.5, Circumference = 82.8 },
new ScatterPlotChartData { Breadth = 43.7, Circumference = 82.7 },
new ScatterPlotChartData { Breadth = 43.5, Circumference = 81.3 },
new ScatterPlotChartData { Breadth = 43.7, Circumference = 80.9 },
new ScatterPlotChartData { Breadth = 43.7, Circumference = 80.94 },
new ScatterPlotChartData { Breadth = 43.5, Circumference = 79.4 },
new ScatterPlotChartData { Breadth = 43.5, Circumference = 79.40 },
new ScatterPlotChartData { Breadth = 43.7, Circumference = 89.0 },
new ScatterPlotChartData { Breadth = 43.5, Circumference = 88.4 },
new ScatterPlotChartData { Breadth = 43.5, Circumference = 88.42 },
new ScatterPlotChartData { Breadth = 43.4, Circumference = 89.45 },
new ScatterPlotChartData { Breadth = 43.0, Circumference = 91.5 },
new ScatterPlotChartData { Breadth = 42.6, Circumference = 87.9 },
new ScatterPlotChartData { Breadth = 42.9, Circumference = 88.4 },
new ScatterPlotChartData { Breadth = 42.9, Circumference = 86.8 },
new ScatterPlotChartData { Breadth = 42.95, Circumference = 86.89 },
new ScatterPlotChartData { Breadth = 43.1, Circumference = 88.5 },
new ScatterPlotChartData { Breadth = 44.2, Circumference = 84.7 },
new ScatterPlotChartData { Breadth = 44.2, Circumference = 84.7 },
new ScatterPlotChartData { Breadth = 44.1, Circumference = 88.6 },
new ScatterPlotChartData { Breadth = 44.1, Circumference = 88.66 },
new ScatterPlotChartData { Breadth = 43.9, Circumference = 87.6 },
new ScatterPlotChartData { Breadth = 44.0, Circumference = 86.6 },
new ScatterPlotChartData { Breadth = 44.3, Circumference = 86.5 },
new ScatterPlotChartData { Breadth = 44.3, Circumference = 86.5 },
new ScatterPlotChartData { Breadth = 44.5, Circumference = 86.9 },
new ScatterPlotChartData { Breadth = 44.57, Circumference = 85.5 },
new ScatterPlotChartData { Breadth = 44.8, Circumference = 85.8 },
new ScatterPlotChartData { Breadth = 45.0, Circumference = 84.6 },
new ScatterPlotChartData { Breadth = 45.0, Circumference = 84.64 },
new ScatterPlotChartData { Breadth = 44.9, Circumference = 82.7 },
new ScatterPlotChartData { Breadth = 44.8, Circumference = 83.7 },
new ScatterPlotChartData { Breadth = 44.8, Circumference = 83.75 },
new ScatterPlotChartData { Breadth = 44.6, Circumference = 83.3 },
new ScatterPlotChartData { Breadth = 44.65, Circumference = 83.37 },
new ScatterPlotChartData { Breadth = 44.65, Circumference = 84.5 },
new ScatterPlotChartData { Breadth = 44.65, Circumference = 84.53 },
new ScatterPlotChartData { Breadth = 44.2, Circumference = 81.8 },
new ScatterPlotChartData { Breadth = 44.9, Circumference = 80.2 },
new ScatterPlotChartData { Breadth = 45.1, Circumference = 85.5 },
new ScatterPlotChartData { Breadth = 44.7, Circumference = 87.1 },
new ScatterPlotChartData { Breadth = 44.7, Circumference = 87.10 },
new ScatterPlotChartData { Breadth = 44.70, Circumference = 87.10 },
new ScatterPlotChartData { Breadth = 44.9, Circumference = 86.8 },
new ScatterPlotChartData { Breadth = 45.1, Circumference = 87.2 },
new ScatterPlotChartData { Breadth = 45.0, Circumference = 88.6 },
new ScatterPlotChartData { Breadth = 45.0, Circumference = 89.4 },
new ScatterPlotChartData { Breadth = 45.0, Circumference = 89.41 },
new ScatterPlotChartData { Breadth = 44.7, Circumference = 88.5 },
new ScatterPlotChartData { Breadth = 44.4, Circumference = 88.3 },
new ScatterPlotChartData { Breadth = 44.4, Circumference = 88.3 },
new ScatterPlotChartData { Breadth = 44.5, Circumference = 89.4 },
new ScatterPlotChartData { Breadth = 44.4, Circumference = 90.0 },
new ScatterPlotChartData { Breadth = 43.9, Circumference = 89.3 },
new ScatterPlotChartData { Breadth = 44.20, Circumference = 90.2 },
new ScatterPlotChartData { Breadth = 44.0, Circumference = 91.2 },
new ScatterPlotChartData { Breadth = 44.0, Circumference = 91.24 },
new ScatterPlotChartData { Breadth = 44.1, Circumference = 88.5 },
new ScatterPlotChartData { Breadth = 44.1, Circumference = 88.53 },
new ScatterPlotChartData { Breadth = 44.16, Circumference = 88.5 },
new ScatterPlotChartData { Breadth = 44.2, Circumference = 91.7 },
new ScatterPlotChartData { Breadth = 44.2, Circumference = 91.75 },
new ScatterPlotChartData { Breadth = 43.9, Circumference = 92.7 },
new ScatterPlotChartData { Breadth = 43.9, Circumference = 92.79 },
new ScatterPlotChartData { Breadth = 44.2, Circumference = 94.8 },
new ScatterPlotChartData { Breadth = 44.0, Circumference = 93.8 },
new ScatterPlotChartData { Breadth = 44.0, Circumference = 93.81 },
new ScatterPlotChartData { Breadth = 44.4, Circumference = 95.6 },
new ScatterPlotChartData { Breadth = 44.8, Circumference = 97.4 },
new ScatterPlotChartData { Breadth = 44.8, Circumference = 93.6 },
new ScatterPlotChartData { Breadth = 44.81, Circumference = 93.67 },
new ScatterPlotChartData { Breadth = 44.6, Circumference = 92.5 },
new ScatterPlotChartData { Breadth = 44.7, Circumference = 94.57 },
new ScatterPlotChartData { Breadth = 45.2, Circumference = 92.2 },
new ScatterPlotChartData { Breadth = 45.2, Circumference = 92.24 },
new ScatterPlotChartData { Breadth = 45.1, Circumference = 94.0 },
new ScatterPlotChartData { Breadth = 45.1, Circumference = 94.0 },
new ScatterPlotChartData { Breadth = 44.9, Circumference = 90.4 },
new ScatterPlotChartData { Breadth = 44.9, Circumference = 89.4 },
new ScatterPlotChartData { Breadth = 44.7, Circumference = 90.4 },
new ScatterPlotChartData { Breadth = 44.7, Circumference = 90.45 }
};
ViewData["Cluster1Value"] = Cluster1Value;
List<ScatterPlotChartData> Cluster2Value = new List<ScatterPlotChartData>
{
new ScatterPlotChartData { Breadth = 45.6, Circumference = 91.6 },
new ScatterPlotChartData { Breadth = 46.0, Circumference = 92.6 },
new ScatterPlotChartData { Breadth = 46.4, Circumference = 94.7 },
new ScatterPlotChartData { Breadth = 46.9, Circumference = 97.3 },
new ScatterPlotChartData { Breadth = 46.9, Circumference = 97.3 },
new ScatterPlotChartData { Breadth = 46.8, Circumference = 98.7 },
new ScatterPlotChartData { Breadth = 46.84, Circumference = 98.72 },
new ScatterPlotChartData { Breadth = 45.4, Circumference = 95.9 },
new ScatterPlotChartData { Breadth = 45.4, Circumference = 94.8 },
new ScatterPlotChartData { Breadth = 45.2, Circumference = 97.2 },
new ScatterPlotChartData { Breadth = 45.2, Circumference = 95.9 },
new ScatterPlotChartData { Breadth = 45.3, Circumference = 97.4 },
new ScatterPlotChartData { Breadth = 46.2, Circumference = 96.6 },
new ScatterPlotChartData { Breadth = 46.2, Circumference = 98.3 },
new ScatterPlotChartData { Breadth = 46.3, Circumference = 96.9 },
new ScatterPlotChartData { Breadth = 46.3, Circumference = 96.9 },
new ScatterPlotChartData { Breadth = 46.0, Circumference = 97.0 },
new ScatterPlotChartData { Breadth = 46.0, Circumference = 97.7 },
new ScatterPlotChartData { Breadth = 45.7, Circumference = 97.5 },
new ScatterPlotChartData { Breadth = 45.7, Circumference = 98.8 },
new ScatterPlotChartData { Breadth = 45.79, Circumference = 98.88 },
new ScatterPlotChartData { Breadth = 45.79, Circumference = 98.88 },
new ScatterPlotChartData { Breadth = 45.6, Circumference = 98.7 },
new ScatterPlotChartData { Breadth = 45.63, Circumference = 98.75 },
new ScatterPlotChartData { Breadth = 45.5, Circumference = 99.9 },
new ScatterPlotChartData { Breadth = 45.6, Circumference = 101.4 },
new ScatterPlotChartData { Breadth = 45.7, Circumference = 102.6 },
new ScatterPlotChartData { Breadth = 45.7, Circumference = 102.62 },
new ScatterPlotChartData { Breadth = 45.3, Circumference = 101.3 },
new ScatterPlotChartData { Breadth = 45.3, Circumference = 103.0 },
new ScatterPlotChartData { Breadth = 45.1, Circumference = 100.7 },
new ScatterPlotChartData { Breadth = 45.1, Circumference = 100.70 },
new ScatterPlotChartData { Breadth = 45.5, Circumference = 102.7 },
new ScatterPlotChartData { Breadth = 45.5, Circumference = 103.9 },
new ScatterPlotChartData { Breadth = 45.4, Circumference = 105.3 },
new ScatterPlotChartData { Breadth = 45.2, Circumference = 108.1 },
new ScatterPlotChartData { Breadth = 45.6, Circumference = 108.2 },
new ScatterPlotChartData { Breadth = 45.5, Circumference = 107.3 },
new ScatterPlotChartData { Breadth = 46.3, Circumference = 107.6 },
new ScatterPlotChartData { Breadth = 45.9, Circumference = 106.0 },
new ScatterPlotChartData { Breadth = 45.8, Circumference = 104.9 },
new ScatterPlotChartData { Breadth = 45.9, Circumference = 104.1 },
new ScatterPlotChartData { Breadth = 46.0, Circumference = 103.7 },
new ScatterPlotChartData { Breadth = 46.07, Circumference = 105.3 },
new ScatterPlotChartData { Breadth = 46.0, Circumference = 105.31 },
new ScatterPlotChartData { Breadth = 46.3, Circumference = 105.4 },
new ScatterPlotChartData { Breadth = 46.3, Circumference = 105.43 },
new ScatterPlotChartData { Breadth = 46.5, Circumference = 105.1 },
new ScatterPlotChartData { Breadth = 46.58, Circumference = 105.17 },
new ScatterPlotChartData { Breadth = 46.6, Circumference = 104.5 },
new ScatterPlotChartData { Breadth = 46.7, Circumference = 104.2 },
new ScatterPlotChartData { Breadth = 46.5, Circumference = 102.9 },
new ScatterPlotChartData { Breadth = 46.4, Circumference = 102.7 },
new ScatterPlotChartData { Breadth = 46.0, Circumference = 102.6 },
new ScatterPlotChartData { Breadth = 46.2, Circumference = 104.1 },
new ScatterPlotChartData { Breadth = 46.2, Circumference = 104.15 },
new ScatterPlotChartData { Breadth = 46.2, Circumference = 104.15 },
new ScatterPlotChartData { Breadth = 46.3, Circumference = 101.3 },
new ScatterPlotChartData { Breadth = 46.6, Circumference = 100.4 },
new ScatterPlotChartData { Breadth = 46.4, Circumference = 99.6 },
new ScatterPlotChartData { Breadth = 46.4, Circumference = 100.2 },
new ScatterPlotChartData { Breadth = 46.1, Circumference = 100.29 },
new ScatterPlotChartData { Breadth = 45.9, Circumference = 99.5 },
new ScatterPlotChartData { Breadth = 46.94, Circumference = 102.0 },
new ScatterPlotChartData { Breadth = 46.9, Circumference = 102.07 },
new ScatterPlotChartData { Breadth = 47.1, Circumference = 99.8 },
new ScatterPlotChartData { Breadth = 46.8, Circumference = 101.1 },
new ScatterPlotChartData { Breadth = 47.0, Circumference = 101.2 },
new ScatterPlotChartData { Breadth = 47.7, Circumference = 96.7 },
new ScatterPlotChartData { Breadth = 47.5, Circumference = 98.9 },
new ScatterPlotChartData { Breadth = 47.5, Circumference = 100.3 },
new ScatterPlotChartData { Breadth = 47.5, Circumference = 100.38 },
new ScatterPlotChartData { Breadth = 47.5, Circumference = 101.5 },
new ScatterPlotChartData { Breadth = 47.2, Circumference = 102.9 },
new ScatterPlotChartData { Breadth = 46.8, Circumference = 103.7 },
new ScatterPlotChartData { Breadth = 47.1, Circumference = 102.4 },
new ScatterPlotChartData { Breadth = 46.9, Circumference = 104.2 },
new ScatterPlotChartData { Breadth = 47.0, Circumference = 105.2 },
new ScatterPlotChartData { Breadth = 46.7, Circumference = 106.4 },
new ScatterPlotChartData { Breadth = 47.1, Circumference = 106.0 },
new ScatterPlotChartData { Breadth = 46.9, Circumference = 106.0 },
new ScatterPlotChartData { Breadth = 47.0, Circumference = 106.4 },
new ScatterPlotChartData { Breadth = 47.2, Circumference = 106.5 },
new ScatterPlotChartData { Breadth = 47.2, Circumference = 108.2 },
new ScatterPlotChartData { Breadth = 47.2, Circumference = 109.1 },
new ScatterPlotChartData { Breadth = 47.0, Circumference = 109.9 },
new ScatterPlotChartData { Breadth = 46.9, Circumference = 108.3 },
new ScatterPlotChartData { Breadth = 46.5, Circumference = 108.9 },
new ScatterPlotChartData { Breadth = 47.1, Circumference = 113.9 },
new ScatterPlotChartData { Breadth = 46.3, Circumference = 113.5 },
new ScatterPlotChartData { Breadth = 46.3, Circumference = 110.8 },
new ScatterPlotChartData { Breadth = 46.32, Circumference = 110.8 },
new ScatterPlotChartData { Breadth = 46.4, Circumference = 111.7 },
new ScatterPlotChartData { Breadth = 46.8, Circumference = 112.2 },
new ScatterPlotChartData { Breadth = 46.9, Circumference = 112.2 },
new ScatterPlotChartData { Breadth = 47.1, Circumference = 111.7 },
new ScatterPlotChartData { Breadth = 47.3, Circumference = 110.8 },
new ScatterPlotChartData { Breadth = 47.4, Circumference = 106.8 }
};
ViewData["Cluster2Value"] = Cluster2Value;
List<ScatterPlotChartData> Cluster3Value = new List<ScatterPlotChartData>
{
new ScatterPlotChartData { Breadth = 47.6, Circumference = 96.5 },
new ScatterPlotChartData { Breadth = 47.6, Circumference = 98.3 },
new ScatterPlotChartData { Breadth = 47.5, Circumference = 100.2 },
new ScatterPlotChartData { Breadth = 47.5, Circumference = 103.0 },
new ScatterPlotChartData { Breadth = 47.6, Circumference = 104.3 },
new ScatterPlotChartData { Breadth = 47.8, Circumference = 103.7 },
new ScatterPlotChartData { Breadth = 48.3, Circumference = 102.9 },
new ScatterPlotChartData { Breadth = 48.2, Circumference = 103.7 },
new ScatterPlotChartData { Breadth = 48.3, Circumference = 103.8 },
new ScatterPlotChartData { Breadth = 48.6, Circumference = 103.7 },
new ScatterPlotChartData { Breadth = 48.7, Circumference = 104.4 },
new ScatterPlotChartData { Breadth = 48.8, Circumference = 103.7 },
new ScatterPlotChartData { Breadth = 48.3, Circumference = 105.5 },
new ScatterPlotChartData { Breadth = 48.3, Circumference = 105.52 },
new ScatterPlotChartData { Breadth = 48.4, Circumference = 106.2 },
new ScatterPlotChartData { Breadth = 48.46, Circumference = 104.7 },
new ScatterPlotChartData { Breadth = 48.7, Circumference = 104.9 },
new ScatterPlotChartData { Breadth = 48.7, Circumference = 104.99 },
new ScatterPlotChartData { Breadth = 48.7, Circumference = 104.9 },
new ScatterPlotChartData { Breadth = 48.8, Circumference = 106.66 },
new ScatterPlotChartData { Breadth = 49.3, Circumference = 106.2 },
new ScatterPlotChartData { Breadth = 49.0, Circumference = 106.0 },
new ScatterPlotChartData { Breadth = 49.2, Circumference = 104.3 },
new ScatterPlotChartData { Breadth = 49.7, Circumference = 109.8 },
new ScatterPlotChartData { Breadth = 49.6, Circumference = 108.0 },
new ScatterPlotChartData { Breadth = 49.5, Circumference = 108.0 },
new ScatterPlotChartData { Breadth = 49.3, Circumference = 106.7 },
new ScatterPlotChartData { Breadth = 49.1, Circumference = 106.78 },
new ScatterPlotChartData { Breadth = 49.0, Circumference = 108.3 },
new ScatterPlotChartData { Breadth = 49.1, Circumference = 109.2 },
new ScatterPlotChartData { Breadth = 49.3, Circumference = 108.0 },
new ScatterPlotChartData { Breadth = 48.9, Circumference = 107.3 },
new ScatterPlotChartData { Breadth = 47.7, Circumference = 106.9 },
new ScatterPlotChartData { Breadth = 48.1, Circumference = 106.6 },
new ScatterPlotChartData { Breadth = 47.9, Circumference = 105.9 },
new ScatterPlotChartData { Breadth = 47.9, Circumference = 107.5 },
new ScatterPlotChartData { Breadth = 47.8, Circumference = 107.0 },
new ScatterPlotChartData { Breadth = 47.8, Circumference = 107.0 },
new ScatterPlotChartData { Breadth = 48.3, Circumference = 107.06 },
new ScatterPlotChartData { Breadth = 48.1, Circumference = 108.1 },
new ScatterPlotChartData { Breadth = 48.4, Circumference = 107.7 },
new ScatterPlotChartData { Breadth = 48.2, Circumference = 107.71 },
new ScatterPlotChartData { Breadth = 48.3, Circumference = 108.8 },
new ScatterPlotChartData { Breadth = 48.31, Circumference = 109.8 },
new ScatterPlotChartData { Breadth = 48.0, Circumference = 108.8 },
new ScatterPlotChartData { Breadth = 47.9, Circumference = 109.3 },
new ScatterPlotChartData { Breadth = 47.8, Circumference = 109.9 },
new ScatterPlotChartData { Breadth = 47.8, Circumference = 110.9 },
new ScatterPlotChartData { Breadth = 47.82, Circumference = 112.4 },
new ScatterPlotChartData { Breadth = 48.1, Circumference = 112.6 },
new ScatterPlotChartData { Breadth = 47.9, Circumference = 111.3 },
new ScatterPlotChartData { Breadth = 47.9, Circumference = 111.32 },
new ScatterPlotChartData { Breadth = 48.6, Circumference = 112.9 },
new ScatterPlotChartData { Breadth = 48.0, Circumference = 113.2 },
new ScatterPlotChartData { Breadth = 47.8, Circumference = 108.8 },
new ScatterPlotChartData { Breadth = 49.0, Circumference = 115.0 },
new ScatterPlotChartData { Breadth = 48.9, Circumference = 115.0 },
new ScatterPlotChartData { Breadth = 47.6, Circumference = 108.2 },
new ScatterPlotChartData { Breadth = 47.6, Circumference = 110.0 },
new ScatterPlotChartData { Breadth = 47.7, Circumference = 108.6 },
new ScatterPlotChartData { Breadth = 47.9, Circumference = 117.5 },
new ScatterPlotChartData { Breadth = 48.3, Circumference = 118.3 },
new ScatterPlotChartData { Breadth = 48.6, Circumference = 118.9 },
new ScatterPlotChartData { Breadth = 48.7, Circumference = 122.3 },
new ScatterPlotChartData { Breadth = 49.4, Circumference = 120.8 },
new ScatterPlotChartData { Breadth = 49.3, Circumference = 117.7 },
new ScatterPlotChartData { Breadth = 48.6, Circumference = 115.9 },
new ScatterPlotChartData { Breadth = 48.7, Circumference = 116.4 },
new ScatterPlotChartData { Breadth = 48.3, Circumference = 115.5 },
new ScatterPlotChartData { Breadth = 49.2, Circumference = 115.2 },
new ScatterPlotChartData { Breadth = 49.5, Circumference = 115.27 },
new ScatterPlotChartData { Breadth = 48.6, Circumference = 113.2 },
new ScatterPlotChartData { Breadth = 48.5, Circumference = 112.4 },
new ScatterPlotChartData { Breadth = 49.0, Circumference = 113.2 },
new ScatterPlotChartData { Breadth = 48.9, Circumference = 112.5 },
new ScatterPlotChartData { Breadth = 48.8, Circumference = 110.9 },
new ScatterPlotChartData { Breadth = 48.6, Circumference = 109.8 },
new ScatterPlotChartData { Breadth = 48.6, Circumference = 108.0 },
new ScatterPlotChartData { Breadth = 48.5, Circumference = 110.4 },
new ScatterPlotChartData { Breadth = 48.5, Circumference = 108.8 },
new ScatterPlotChartData { Breadth = 48.8, Circumference = 110.6 },
new ScatterPlotChartData { Breadth = 48.8, Circumference = 110.65 },
new ScatterPlotChartData { Breadth = 49.0, Circumference = 109.8 },
new ScatterPlotChartData { Breadth = 49.2, Circumference = 111.6 },
new ScatterPlotChartData { Breadth = 48.8, Circumference = 111.9 },
new ScatterPlotChartData { Breadth = 48.9, Circumference = 111.6 },
new ScatterPlotChartData { Breadth = 49.3, Circumference = 111.4 },
new ScatterPlotChartData { Breadth = 49.3, Circumference = 111.42 },
new ScatterPlotChartData { Breadth = 49.3, Circumference = 111.6 },
new ScatterPlotChartData { Breadth = 49.4, Circumference = 112.1 },
new ScatterPlotChartData { Breadth = 49.5, Circumference = 112.9 },
new ScatterPlotChartData { Breadth = 49.7, Circumference = 113.2 },
new ScatterPlotChartData { Breadth = 49.9, Circumference = 113.3 },
new ScatterPlotChartData { Breadth = 49.6, Circumference = 113.7 },
new ScatterPlotChartData { Breadth = 48.9, Circumference = 111.3 },
new ScatterPlotChartData { Breadth = 49.0, Circumference = 112.0 },
new ScatterPlotChartData { Breadth = 48.8, Circumference = 109.3 }
};
ViewData["Cluster3Value"] = Cluster3Value;
List<ScatterPlotChartData> Cluster4Value = new List<ScatterPlotChartData>
{
new ScatterPlotChartData { Breadth = 50.3, Circumference = 107.0 },
new ScatterPlotChartData { Breadth = 50.1, Circumference = 107.5 },
new ScatterPlotChartData { Breadth = 50.0, Circumference = 110.2 },
new ScatterPlotChartData { Breadth = 49.8, Circumference = 110.7 },
new ScatterPlotChartData { Breadth = 50.0, Circumference = 111.2 },
new ScatterPlotChartData { Breadth = 50.0, Circumference = 112.0 },
new ScatterPlotChartData { Breadth = 50.1, Circumference = 112.17 },
new ScatterPlotChartData { Breadth = 50.0, Circumference = 113.2 },
new ScatterPlotChartData { Breadth = 50.6, Circumference = 113.4 },
new ScatterPlotChartData { Breadth = 50.3, Circumference = 114.7 },
new ScatterPlotChartData { Breadth = 50.3, Circumference = 115.3 },
new ScatterPlotChartData { Breadth = 50.2, Circumference = 116.5 },
new ScatterPlotChartData { Breadth = 49.8, Circumference = 116.8 },
new ScatterPlotChartData { Breadth = 49.9, Circumference = 117.9 },
new ScatterPlotChartData { Breadth = 49.94, Circumference = 121.9 },
new ScatterPlotChartData { Breadth = 50.3, Circumference = 123.2 },
new ScatterPlotChartData { Breadth = 50.6, Circumference = 121.4 },
new ScatterPlotChartData { Breadth = 50.9, Circumference = 121.0 },
new ScatterPlotChartData { Breadth = 50.7, Circumference = 118.4 },
new ScatterPlotChartData { Breadth = 50.70, Circumference = 118.2 },
new ScatterPlotChartData { Breadth = 50.8, Circumference = 117.1 },
new ScatterPlotChartData { Breadth = 50.8, Circumference = 115.2 },
new ScatterPlotChartData { Breadth = 50.9, Circumference = 112.7 },
new ScatterPlotChartData { Breadth = 50.6, Circumference = 112.4 },
new ScatterPlotChartData { Breadth = 50.5, Circumference = 111.5 },
new ScatterPlotChartData { Breadth = 50.7, Circumference = 110.6 },
new ScatterPlotChartData { Breadth = 50.7, Circumference = 111.3 },
new ScatterPlotChartData { Breadth = 50.8, Circumference = 110.9 },
new ScatterPlotChartData { Breadth = 51.0, Circumference = 111.8 },
new ScatterPlotChartData { Breadth = 50.7, Circumference = 108.8 },
new ScatterPlotChartData { Breadth = 50.6, Circumference = 108.2 },
new ScatterPlotChartData { Breadth = 50.65, Circumference = 108.2 },
new ScatterPlotChartData { Breadth = 51.2, Circumference = 108.6 },
new ScatterPlotChartData { Breadth = 51.8, Circumference = 112.0 },
new ScatterPlotChartData { Breadth = 52.3, Circumference = 113.6 },
new ScatterPlotChartData { Breadth = 51.1, Circumference = 115.4 },
new ScatterPlotChartData { Breadth = 51.8, Circumference = 115.7 },
new ScatterPlotChartData { Breadth = 51.7, Circumference = 117.2 },
new ScatterPlotChartData { Breadth = 52.0, Circumference = 119.5 },
new ScatterPlotChartData { Breadth = 52.0, Circumference = 120.6 },
new ScatterPlotChartData { Breadth = 51.9, Circumference = 122.9 },
new ScatterPlotChartData { Breadth = 51.9, Circumference = 124.8 },
new ScatterPlotChartData { Breadth = 51.17, Circumference = 124.7 },
new ScatterPlotChartData { Breadth = 52.3, Circumference = 128.0 },
new ScatterPlotChartData { Breadth = 52.3, Circumference = 128.0 },
new ScatterPlotChartData { Breadth = 52.6, Circumference = 124.9 },
new ScatterPlotChartData { Breadth = 52.7, Circumference = 124.2 },
new ScatterPlotChartData { Breadth = 52.5, Circumference = 120.2 },
new ScatterPlotChartData { Breadth = 52.8, Circumference = 119.7 }
};
ViewData["Cluster4Value"] = Cluster4Value;
List<ScatterPlotChartData> Cluster5Value = new List<ScatterPlotChartData>
{
new ScatterPlotChartData { Breadth = 53.1, Circumference = 121.3 },
new ScatterPlotChartData { Breadth = 53.0, Circumference = 122.4 },
new ScatterPlotChartData { Breadth = 54.6, Circumference = 133.4 },
new ScatterPlotChartData { Breadth = 53.3, Circumference = 122.6 },
new ScatterPlotChartData { Breadth = 53.6, Circumference = 125.4 },
new ScatterPlotChartData { Breadth = 53.9, Circumference = 128.5 },
new ScatterPlotChartData { Breadth = 53.3, Circumference = 125.7 },
new ScatterPlotChartData { Breadth = 53.3, Circumference = 125.78 },
new ScatterPlotChartData { Breadth = 54.0, Circumference = 127.0 },
new ScatterPlotChartData { Breadth = 54.0, Circumference = 127.05 },
new ScatterPlotChartData { Breadth = 53.1, Circumference = 127.3 },
new ScatterPlotChartData { Breadth = 53.6, Circumference = 121.36 },
new ScatterPlotChartData { Breadth = 52.6, Circumference = 123.4 },
new ScatterPlotChartData { Breadth = 54.0, Circumference = 123.2 },
new ScatterPlotChartData { Breadth = 53.8, Circumference = 124.8 },
new ScatterPlotChartData { Breadth = 53.3, Circumference = 123.3 },
new ScatterPlotChartData { Breadth = 53.3, Circumference = 124.3 },
new ScatterPlotChartData { Breadth = 53.8, Circumference = 123.6 },
new ScatterPlotChartData { Breadth = 53.8, Circumference = 124.61 },
new ScatterPlotChartData { Breadth = 53.5, Circumference = 123.5 }
};
ViewData["Cluster5Value"] = Cluster5Value;
return View();
}
public class ScatterPlotChartData
{
public double Breadth { get; set; }
public double Circumference { get; set; }
}
}
}
@* Install once: Install-Package Lumen.UI.Mvc (or: dotnet add package Lumen.UI.Mvc) *@
@* Views/Web.config: <add namespace="Lumen.UI.Mvc" /> *@
@* Views/Shared/_Layout.cshtml *@
<head>
@Html.UiStyles()
<link rel="stylesheet" href="~/Content/site.css" />
</head>
<body>
@RenderBody()
@Html.UiScripts()
@RenderSection("scripts", required: false)
</body>
@* Charts with a DataUrl: @Html.AntiForgeryToken() on the page and [HttpPost, ValidateJsonAntiForgeryToken] on the action. *@
In this example, you can see how to render and configure the scatter chart. The scatter chart is used to plot data with two numeric parameters. You can use the Shape property in the marker to change the scatter shape.
Tooltip is enabled in this example. To see the tooltip in action, hover over a point or tap on a point in touch-enabled devices.