- Range Column
- Binding data with series
- Series customization
- Empty points
- Corner radius
- Events
- See also
Contact Support
Range Column in ASP.NET CORE Charts Component
8 Apr 202524 minutes to read
Range Column
To render a range column series in your chart, you need to follow a few steps to configure it correctly. Here’s a concise guide on how to do this:
-
Set the series type: Define the series
type
as RangeColumn in your chart configuration. This indicates that the data should be represented as a range column chart, which is ideal for visualizing data that has both minimum and maximum values for each category. This is especially useful for visualizing data ranges, such as temperature fluctuations over time, stock prices, or any other data with upper and lower bounds. -
Provide high and low values: The RangeColumn series requires two y-values for each data point, you need to specify both the high and low values. The high value represents the maximum range, while the low value represents the minimum range for each data point. These values define the upper and lower boundaries of the column for each point on the chart.
<ejs-chart id="container">
<e-chart-primaryxaxis valueType="Category">
</e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" high="high" low="low"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn"></e-series>
</e-series-collection>
</ejs-chart>
public ActionResult Index()
{
List<AxisLabelData> chartData = new List<AxisLabelData>
{
new AxisLabelData { x= "Sun", low= 2.5, high= 9.8 },
new AxisLabelData { x= "Mon", low= 4.7, high= 11.4 },
new AxisLabelData { x= "Tue", low= 6.4, high= 14.4 },
new AxisLabelData { x= "Wed", low= 9.6, high= 17.2 },
new AxisLabelData { x= "Thu", low= 7.5, high= 15.1 },
new AxisLabelData { x= "Fri", low= 3.0, high= 10.5 },
new AxisLabelData { x= "Sat", low= 1.2, high= 7.9 }
};
ViewBag.dataSource = chartData;
return View();
}
public class AxisLabelData
{
public string x;
public double low;
public double high;
}
Binding data with series
You can bind data to the chart using the dataSource
property within the series configuration. This allows you to connect a JSON dataset or remote data to your chart. To display the data correctly, map the fields from the data to the chart series xName
, high
, and low
properties.
<ejs-chart id="container">
<e-chart-primaryxaxis valueType="Category">
</e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" high="high" low="low"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn"></e-series>
</e-series-collection>
</ejs-chart>
public ActionResult Index()
{
List<AxisLabelData> chartData = new List<AxisLabelData>
{
new AxisLabelData { x= "Sun", low= 2.5, high= 9.8 },
new AxisLabelData { x= "Mon", low= 4.7, high= 11.4 },
new AxisLabelData { x= "Tue", low= 6.4, high= 14.4 },
new AxisLabelData { x= "Wed", low= 9.6, high= 17.2 },
new AxisLabelData { x= "Thu", low= 7.5, high= 15.1 },
new AxisLabelData { x= "Fri", low= 3.0, high= 10.5 },
new AxisLabelData { x= "Sat", low= 1.2, high= 7.9 }
};
ViewBag.dataSource = chartData;
return View();
}
public class AxisLabelData
{
public string x;
public double low;
public double high;
}
Series customization
The following properties can be used to customize the range column
series.
Fill
The fill
property determines the color applied to the series.
<ejs-chart id="container">
<e-chart-primaryxaxis valueType="Category">
</e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" high="high" low="low"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn" fill="blue"></e-series>
</e-series-collection>
</ejs-chart>
public ActionResult Index()
{
List<AxisLabelData> chartData = new List<AxisLabelData>
{
new AxisLabelData { x= "Sun", low= 2.5, high= 9.8 },
new AxisLabelData { x= "Mon", low= 4.7, high= 11.4 },
new AxisLabelData { x= "Tue", low= 6.4, high= 14.4 },
new AxisLabelData { x= "Wed", low= 9.6, high= 17.2 },
new AxisLabelData { x= "Thu", low= 7.5, high= 15.1 },
new AxisLabelData { x= "Fri", low= 3.0, high= 10.5 },
new AxisLabelData { x= "Sat", low= 1.2, high= 7.9 }
};
ViewBag.dataSource = chartData;
return View();
}
public class AxisLabelData
{
public string x;
public double low;
public double high;
}
The fill
property can be used to apply a gradient color to the range column series. By configuring this property with gradient values, you can create a visually appealing effect in which the color transitions smoothly from one shade to another.
<svg style="width:1px; height:1px">
<defs>
<linearGradient id="gradient">
<stop offset="0%" style="stop-color:blue;stop-opacity:5" />
<stop offset="50%" style="stop-color:violet;stop-opacity:5" />
</linearGradient>
</defs>
</svg>
<ejs-chart id="container">
<e-chart-primaryxaxis valueType="Category">
</e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" high="high" low="low"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn" fill="url(#gradient)"></e-series>
</e-series-collection>
</ejs-chart>
public ActionResult Index()
{
List<AxisLabelData> chartData = new List<AxisLabelData>
{
new AxisLabelData { x= "Sun", low= 2.5, high= 9.8 },
new AxisLabelData { x= "Mon", low= 4.7, high= 11.4 },
new AxisLabelData { x= "Tue", low= 6.4, high= 14.4 },
new AxisLabelData { x= "Wed", low= 9.6, high= 17.2 },
new AxisLabelData { x= "Thu", low= 7.5, high= 15.1 },
new AxisLabelData { x= "Fri", low= 3.0, high= 10.5 },
new AxisLabelData { x= "Sat", low= 1.2, high= 7.9 }
};
ViewBag.dataSource = chartData;
return View();
}
public class AxisLabelData
{
public string x;
public double low;
public double high;
}
Opacity
The opacity
property specifies the transparency level of the fill. Adjusting this property allows you to control how opaque or transparent the fill color of the series appears.
<ejs-chart id="container">
<e-chart-primaryxaxis valueType="Category">
</e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" high="high" low="low"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn" opacity="0.5"></e-series>
</e-series-collection>
</ejs-chart>
public ActionResult Index()
{
List<AxisLabelData> chartData = new List<AxisLabelData>
{
new AxisLabelData { x= "Sun", low= 2.5, high= 9.8 },
new AxisLabelData { x= "Mon", low= 4.7, high= 11.4 },
new AxisLabelData { x= "Tue", low= 6.4, high= 14.4 },
new AxisLabelData { x= "Wed", low= 9.6, high= 17.2 },
new AxisLabelData { x= "Thu", low= 7.5, high= 15.1 },
new AxisLabelData { x= "Fri", low= 3.0, high= 10.5 },
new AxisLabelData { x= "Sat", low= 1.2, high= 7.9 }
};
ViewBag.dataSource = chartData;
return View();
}
public class AxisLabelData
{
public string x;
public double low;
public double high;
}
Border
Use the border
property to customize the width, color and dasharray of the series border.
<ejs-chart id="container" width="60%">
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" yName="y"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn">
<e-series-border width="2" Color="#FFA500" dashArray="5,5"></e-series-border>
</e-series>
</e-series-collection>
</ejs-chart>
public ActionResult Index()
{
List<AxisLabelData> chartData = new List<AxisLabelData>
{
new AxisLabelData { x= "Sun", low= 2.5, high= 9.8 },
new AxisLabelData { x= "Mon", low= 4.7, high= 11.4 },
new AxisLabelData { x= "Tue", low= 6.4, high= 14.4 },
new AxisLabelData { x= "Wed", low= 9.6, high= 17.2 },
new AxisLabelData { x= "Thu", low= 7.5, high= 15.1 },
new AxisLabelData { x= "Fri", low= 3.0, high= 10.5 },
new AxisLabelData { x= "Sat", low= 1.2, high= 7.9 }
};
ViewBag.dataSource = chartData;
ChartBorder border = new ChartBorder();
border.Width = 2;
border.Color = "#962D18";
border.DashArray="5,5";
ViewBag.seriesBorder = border;
return View();
}
public class AxisLabelData
{
public string x;
public double low;
public double high;
}
Empty points
Data points with null or undefined values are considered empty. Empty data points are ignored and not plotted on the chart.
Mode
Use the mode
property to define how empty or missing data points are handled in the series. The default mode for empty points is Gap.
<ejs-chart id="container">
<e-chart-primaryxaxis valueType="Category">
</e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" high="high" low="low"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn">
<e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Zero"></e-series-emptypointsettings>
</e-series>
</e-series-collection>
</ejs-chart>
public ActionResult Index()
{
List<AxisLabelData> chartData = new List<AxisLabelData>
{
new AxisLabelData { x= "Sun", low= 2.5, high= 9.8 },
new AxisLabelData { x= "Mon", low= 4.7, high= 11.4 },
new AxisLabelData { x= "Tue", low= null, high= 14.4 },
new AxisLabelData { x= "Wed", low= 9.6, high= 17.2 },
new AxisLabelData { x= "Thu", low= 7.5 },
new AxisLabelData { x= "Fri", low= 3.0, high= 10.5 },
new AxisLabelData { x= "Sat", low= 1.2, high= 7.9 }
};
ViewBag.dataSource = chartData;
ChartEmptyPointSettings emptyPointSettings = new ChartEmptyPointSettings();
emptyPointSettings.Mode = EmptyPointMode.Zero;
ViewBag.empty = emptyPointSettings;
return View();
}
public class AxisLabelData
{
public string x;
public double low;
public double high;
}
Fill
Use the fill
property to customize the fill color of empty points in the series.
<ejs-chart id="container">
<e-chart-primaryxaxis valueType="Category">
</e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" high="high" low="low"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn">
<e-series-marker visible="true" height="7" width="7" isFilled="true"></e-series-marker>
<e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Zero" fill="red"></e-series-emptypointsettings>
</e-series>
</e-series-collection>
</ejs-chart>
public ActionResult Index()
{
List<AxisLabelData> chartData = new List<AxisLabelData>
{
new AxisLabelData { x= "Sun", low= 2.5, high= 9.8 },
new AxisLabelData { x= "Mon", low= 4.7, high= 11.4 },
new AxisLabelData { x= "Tue", low= null, high= 14.4 },
new AxisLabelData { x= "Wed", low= 9.6, high= 17.2 },
new AxisLabelData { x= "Thu", low= 7.5 },
new AxisLabelData { x= "Fri", low= 3.0, high= 10.5 },
new AxisLabelData { x= "Sat", low= 1.2, high= 7.9 }
};
ViewBag.dataSource = chartData;
ChartEmptyPointSettings emptyPointSettings = new ChartEmptyPointSettings();
emptyPointSettings.Mode = EmptyPointMode.Average;
emptyPointSettings.Fill = "red";
ViewBag.empty = emptyPointSettings;
ChartMarkerSettings markerSettings = new ChartMarkerSettings();
markerSettings.Visible = true;
markerSettings.Width = 7;
markerSettings.Height = 7;
markerSettings.IsFilled = true;
ViewBag.marker = markerSettings;
return View();
}
public class AxisLabelData
{
public string x;
public double low;
public double high;
}
Border
Use the border
property to customize the width and color of the border for empty points.
<ejs-chart id="container">
<e-chart-primaryxaxis valueType="Category">
</e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" high="high" low="low"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn">
<e-series-marker visible="true" height="7" width="7" isFilled="true"></e-series-marker>
<e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Zero" fill="red">
<e-emptypointsettings-border width="2" color="green"></e-emptypointsettings-border>
</e-series-emptypointsettings>
</e-series>
</e-series-collection>
</ejs-chart>
public ActionResult Index()
{
List<AxisLabelData> chartData = new List<AxisLabelData>
{
new AxisLabelData { x= "Sun", low= 2.5, high= 9.8 },
new AxisLabelData { x= "Mon", low= 4.7, high= 11.4 },
new AxisLabelData { x= "Tue", low= null, high= 14.4 },
new AxisLabelData { x= "Wed", low= 9.6, high= 17.2 },
new AxisLabelData { x= "Thu", low= 7.5 },
new AxisLabelData { x= "Fri", low= 3.0, high= 10.5 },
new AxisLabelData { x= "Sat", low= 1.2, high= 7.9 }
};
ViewBag.dataSource = chartData;
ChartEmptyPointSettings emptyPointSettings = new ChartEmptyPointSettings();
emptyPointSettings.Mode = EmptyPointMode.Average;
emptyPointSettings.Border.Width = 2;
emptyPointSettings.Border.Color = "green";
ViewBag.empty = emptyPointSettings;
ChartMarkerSettings markerSettings = new ChartMarkerSettings();
markerSettings.Visible = true;
markerSettings.Width = 7;
markerSettings.Height = 7;
markerSettings.IsFilled = true;
ViewBag.marker = markerSettings;
return View();
}
public class AxisLabelData
{
public string x;
public double low;
public double high;
}
Corner radius
The CornerRadius
property in the chart series is used to customize the corner radius for range column series. This allows you to create range columns with rounded corners, giving your chart a more polished appearance. You can customize each corner of the range columns using the topLeft, topRight, bottomLeft, and bottomRight properties.
<ejs-chart id="container" title="Maximum and Minimum Temperature">
<e-chart-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category" title="Month">
</e-chart-primaryxaxis>
<e-chart-primaryyaxis title="Temperature(Celsius)" labelFormat="{value}°C">
</e-chart-primaryyaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="X" high="High" low="Low" type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn">
<e-series-cornerradius topLeft="10" topRight="10" bottomLeft="10" bottomRight="10"></e-series-cornerradius>
</e-series>
<e-series dataSource="ViewBag.dataSource" xName="X" high="High1" low="Low1" type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn">
<e-series-cornerradius topLeft="10" topRight="10" bottomLeft="10" bottomRight="10"></e-series-cornerradius>
</e-series>
</e-series-collection>
</ejs-chart>
public ActionResult Index()
{
List<RangeChartData> chartData = new List<RangeChartData>
{
new RangeChartData { X = "Jan", Low = 0.7, High = 6.1, Low1 = 1.7, High1 = 7.1 },
new RangeChartData { X = "Feb", Low = 1.3, High = 6.3, Low1 = 1.9, High1 = 7.7 },
new RangeChartData { X = "Mar", Low = 1.9, High = 8.5, Low1 = 1.2, High1 = 7.5 },
new RangeChartData { X = "Apr", Low = 3.1, High = 10.8, Low1 = 2.5, High1 = 9.8 },
new RangeChartData { X = "May", Low = 5.7, High = 14.40, Low1 = 4.7, High1 = 11.4 },
new RangeChartData { X = "Jun", Low = 8.4, High = 16.90, Low1 = 6.4, High1 = 14.4 },
new RangeChartData { X = "Jul", Low = 10.6, High = 19.20, Low1 = 9.6, High1 = 17.2 },
new RangeChartData { X = "Aug", Low = 10.5, High = 18.9, Low1 = 10.7, High1 = 17.9 },
new RangeChartData { X = "Sep", Low = 8.5, High = 16.1, Low1 = 7.5, High1 = 15.1 },
new RangeChartData { X = "Oct", Low = 6.0, High = 12.5, Low1 = 3.0, High1 = 10.5 },
new RangeChartData { X = "Nov", Low = 1.5, High = 6.9, Low1 = 1.2, High1 = 7.9 },
new RangeChartData { X = "Dec", Low = 5.1, High = 12.1, Low1 = 4.1, High1 = 9.1 }
};
ViewBag.dataSource = chartData;
return View();
}
public class RangeChartData
{
public string X;
public double Low;
public double High;
public double Low1;
public double High1;
}
Point corner radius
We can customize the corner radius for individual points in the chart series using the PointRender
event by setting the CornerRadius
property in its event argument.
<ejs-chart id="container" title="Maximum and Minimum Temperature" pointRender="pointRender">
<e-chart-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category" title="Month">
</e-chart-primaryxaxis>
<e-chart-primaryyaxis title="Temperature(Celsius)" labelFormat="{value}°C">
</e-chart-primaryyaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="X" high="High" low="Low" type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn">
</e-series>
<e-series dataSource="ViewBag.dataSource" xName="X" high="High1" low="Low1" type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn">
</e-series>
</e-series-collection>
</ejs-chart>
<script>
function pointRender(args) {
if (args.point.index === 1) {
args.cornerRadius = { topLeft: 10, bottomLeft: 10, topRight: 10, bottomRight: 10 };
}
if (args.point.index === 4) {
args.cornerRadius = { topLeft: 10, bottomLeft: 10, topRight: 10, bottomRight: 10 };
}
}
</script>
public ActionResult Index()
{
List<RangeChartData> chartData = new List<RangeChartData>
{
new RangeChartData { X = "Jan", Low = 0.7, High = 6.1, Low1 = 1.7, High1 = 7.1 },
new RangeChartData { X = "Feb", Low = 1.3, High = 6.3, Low1 = 1.9, High1 = 7.7 },
new RangeChartData { X = "Mar", Low = 1.9, High = 8.5, Low1 = 1.2, High1 = 7.5 },
new RangeChartData { X = "Apr", Low = 3.1, High = 10.8, Low1 = 2.5, High1 = 9.8 },
new RangeChartData { X = "May", Low = 5.7, High = 14.40, Low1 = 4.7, High1 = 11.4 },
new RangeChartData { X = "Jun", Low = 8.4, High = 16.90, Low1 = 6.4, High1 = 14.4 },
new RangeChartData { X = "Jul", Low = 10.6, High = 19.20, Low1 = 9.6, High1 = 17.2 },
new RangeChartData { X = "Aug", Low = 10.5, High = 18.9, Low1 = 10.7, High1 = 17.9 },
new RangeChartData { X = "Sep", Low = 8.5, High = 16.1, Low1 = 7.5, High1 = 15.1 },
new RangeChartData { X = "Oct", Low = 6.0, High = 12.5, Low1 = 3.0, High1 = 10.5 },
new RangeChartData { X = "Nov", Low = 1.5, High = 6.9, Low1 = 1.2, High1 = 7.9 },
new RangeChartData { X = "Dec", Low = 5.1, High = 12.1, Low1 = 4.1, High1 = 9.1 }
};
ViewBag.dataSource = chartData;
return View();
}
public class RangeChartData
{
public string X;
public double Low;
public double High;
public double Low1;
public double High1;
}
Events
Series render
The seriesRender
event allows you to customize series properties, such as data, fill, and name, before they are rendered on the chart.
<ejs-chart id="container" seriesRender="changeColor">
<e-chart-primaryxaxis valueType="Category">
</e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" high="high" low="low"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn">
</e-series>
</e-series-collection>
</ejs-chart>
<script>
function changeColor(args) {
args.fill = '#ff6347';
}
</script>
public ActionResult Index()
{
List<AxisLabelData> chartData = new List<AxisLabelData>
{
new AxisLabelData { x= "Sun", low= 2.5, high= 9.8 },
new AxisLabelData { x= "Mon", low= 4.7, high= 11.4 },
new AxisLabelData { x= "Tue", low= 6.4, high= 14.4 },
new AxisLabelData { x= "Wed", low= 9.6, high= 17.2 },
new AxisLabelData { x= "Thu", low= 7.5, high= 15.1 },
new AxisLabelData { x= "Fri", low= 3.0, high= 10.5 },
new AxisLabelData { x= "Sat", low= 1.2, high= 7.9 }
};
ViewBag.dataSource = chartData;
return View();
}
public class AxisLabelData
{
public string x;
public double low;
public double high;
}
Point render
The pointRender
event allows you to customize each data point before it is rendered on the chart.
<ejs-chart id="container" pointRender="changeColor">
<e-chart-primaryxaxis valueType="Category">
</e-chart-primaryxaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" high="high" low="low"
type="@Syncfusion.EJ2.Charts.ChartSeriesType.RangeColumn">
<e-series-marker visible="true" height="7" width="7" isFilled="true"></e-series-marker>
</e-series>
</e-series-collection>
</ejs-chart>
<script>
function changeColor(args) {
if (args.point.index % 2 !== 0) {
args.fill = '#ff6347';
}
else {
args.fill = '#009cb8';
}
}
</script>
public ActionResult Index()
{
List<AxisLabelData> chartData = new List<AxisLabelData>
{
new AxisLabelData { x= "Sun", low= 2.5, high= 9.8 },
new AxisLabelData { x= "Mon", low= 4.7, high= 11.4 },
new AxisLabelData { x= "Tue", low= 6.4, high= 14.4 },
new AxisLabelData { x= "Wed", low= 9.6, high= 17.2 },
new AxisLabelData { x= "Thu", low= 7.5, high= 15.1 },
new AxisLabelData { x= "Fri", low= 3.0, high= 10.5 },
new AxisLabelData { x= "Sat", low= 1.2, high= 7.9 }
};
ViewBag.dataSource = chartData;
return View();
}
public class AxisLabelData
{
public string x;
public double low;
public double high;
}