Multiple Panes
28 Feb 202216 minutes to read
Chart area can be divided into multiple panes using Rows
and Columns
.
Rows
To split the chart area vertically into number of rows, use Rows
property of the chart.
- You can allocate space for each row by using the
Height
property. The value can be either in percentage or in pixel. - To associate a vertical axis to a particular row, specify its index to
RowIndex
property of the axis. - To customize each row’s bottom line, use
Border
property.
@Html.EJS().Chart("container").Rows(rows =>
{
rows.Height("50%").Add();
rows.Height("50%").Add();
})
.Series(series =>
{
series.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Column).XName("x").YName("y").DataSource(ViewBag.dataSource).Name("Germany").Add();
series.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Line).YAxisName("yAxis").XName("x").Marker(ViewBag.marker).YName("y1").DataSource(ViewBag.dataSource).Name("Japan").Add();
}).PrimaryXAxis(px => px.ValueType(Syncfusion.EJ2.Charts.ValueType.Category)
.Interval(1).LabelIntersectAction(Syncfusion.EJ2.Charts.LabelIntersectAction.Rotate90)
).Axes(ax =>
{
ax.OpposedPosition(true).RowIndex(0).Minimum(24).Maximum(36).Interval(2).Name("yAxis").LabelFormat("{value}°C").Add();
}
)
).Title("Weather Condition JPN vs DEU").ChartArea(area => area.Border(ViewBag.ChartBorder)).Tooltip(tt => tt.Enable(true)).LegendSettings(lg=>lg.Visible(false)).Render()
public ActionResult Index()
{
List<MultipleAxesChartData> chartData = new List<MultipleAxesChartData>
{
new MultipleAxesChartData{ x= "Jan", y= 15, y1= 33 },
new MultipleAxesChartData{ x= "Feb", y= 20, y1= 31 },
new MultipleAxesChartData{ x= "Mar", y= 35, y1= 30 },
new MultipleAxesChartData{ x= "Apr", y= 40, y1= 28 },
new MultipleAxesChartData{ x= "May", y= 80, y1= 29 },
new MultipleAxesChartData{ x= "Jun", y= 70, y1= 30 },
new MultipleAxesChartData{ x= "Jul", y= 65, y1= 33 },
new MultipleAxesChartData{ x= "Aug", y= 55, y1= 32 },
new MultipleAxesChartData{ x= "Sep", y= 50, y1= 34 },
new MultipleAxesChartData{ x= "Oct", y= 30, y1= 32 },
new MultipleAxesChartData{ x= "Nov", y= 35, y1= 32 },
new MultipleAxesChartData{ x= "Dec", y= 35, y1= 31 }
};
ViewBag.dataSource = chartData;
return View();
}
public class MultipleAxesChartData
{
public string x;
public double y;
public double
For spanning the vertical axis along multiple row, you can use Span
property of an axis.
@Html.EJS().Chart("container").
Rows(rows =>
{
rows.Height("50%").Add();
rows.Height("50%").Add();
}).Series(series =>
{
series.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Column).XName("x").YName("y").DataSource(ViewBag.dataSource).Name("Germany").Add();
series.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Line).YAxisName("yAxis").XName("x").Marker(ViewBag.marker).YName("y1").DataSource(ViewBag.dataSource).Name("Japan").Add();
}).PrimaryXAxis(px => px.ValueType(Syncfusion.EJ2.Charts.ValueType.Category)
.Interval(1).LabelIntersectAction(Syncfusion.EJ2.Charts.LabelIntersectAction.Rotate90)
).PrimaryYAxis(py => py.span(2))
.Axes(ax =>
{
ax.OpposedPosition(true).RowIndex(0).Minimum(24).Maximum(36).Interval(2).Name("yAxis").LabelFormat("{value}°C").Add();
}
)
).Title("Weather Condition JPN vs DEU").ChartArea(area => area.Border(ViewBag.ChartBorder)).Tooltip(tt => tt.Enable(true)).LegendSettings(lg=>lg.Visible(false)).Render()
public ActionResult Index()
{
List<MultipleAxesChartData> chartData = new List<MultipleAxesChartData>
{
new MultipleAxesChartData{ x= "Jan", y= 15, y1= 33 },
new MultipleAxesChartData{ x= "Feb", y= 20, y1= 31 },
new MultipleAxesChartData{ x= "Mar", y= 35, y1= 30 },
new MultipleAxesChartData{ x= "Apr", y= 40, y1= 28 },
new MultipleAxesChartData{ x= "May", y= 80, y1= 29 },
new MultipleAxesChartData{ x= "Jun", y= 70, y1= 30 },
new MultipleAxesChartData{ x= "Jul", y= 65, y1= 33 },
new MultipleAxesChartData{ x= "Aug", y= 55, y1= 32 },
new MultipleAxesChartData{ x= "Sep", y= 50, y1= 34 },
new MultipleAxesChartData{ x= "Oct", y= 30, y1= 32 },
new MultipleAxesChartData{ x= "Nov", y= 35, y1= 32 },
new MultipleAxesChartData{ x= "Dec", y= 35, y1= 31 }
};
ViewBag.dataSource = chartData;
return View();
}
public class MultipleAxesChartData
{
public string x;
public double y;
public double
}
Columns
To split the chart area horizontally into number of columns, use Columns
property of the chart.
- You can allocate space for each column by using the
Width
property. The given width can be either in percentage or in pixel. - To associate a horizontal axis to a particular column, specify its index to
ColumnIndex
property of the axis. - To customize each column’s bottom line, use
Border
property.
@Html.EJS().Chart("container").Columns(columns =>
{
columns.width("50%").Add();
columns.width("50%").Add();
})
.Series(series =>
{
series.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Column).XName("x").YName("y").DataSource(ViewBag.dataSource).Name("Germany").Add();
series.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Line).YAxisName("yAxis").XName("x").Marker(ViewBag.marker).YName("y1").DataSource(ViewBag.dataSource).Name("Japan").Add();
}).PrimaryXAxis(px => px.ValueType(Syncfusion.EJ2.Charts.ValueType.Category)
.Interval(1).LabelIntersectAction(Syncfusion.EJ2.Charts.LabelIntersectAction.Rotate90)
).Axes(ax =>
{
ax.OpposedPosition(true).RowIndex(0).Minimum(24).Maximum(36).Interval(2).Name("yAxis").LabelFormat("{value}°C").Add();
}
)
).Title("Weather Condition JPN vs DEU").ChartArea(area => area.Border(ViewBag.ChartBorder)).Tooltip(tt => tt.Enable(true)).LegendSettings(lg=>lg.Visible(false)).Render()
public ActionResult Index()
{
List<MultipleAxesChartData> chartData = new List<MultipleAxesChartData>
{
new MultipleAxesChartData{ x= "Jan", y= 15, y1= 33 },
new MultipleAxesChartData{ x= "Feb", y= 20, y1= 31 },
new MultipleAxesChartData{ x= "Mar", y= 35, y1= 30 },
new MultipleAxesChartData{ x= "Apr", y= 40, y1= 28 },
new MultipleAxesChartData{ x= "May", y= 80, y1= 29 },
new MultipleAxesChartData{ x= "Jun", y= 70, y1= 30 },
new MultipleAxesChartData{ x= "Jul", y= 65, y1= 33 },
new MultipleAxesChartData{ x= "Aug", y= 55, y1= 32 },
new MultipleAxesChartData{ x= "Sep", y= 50, y1= 34 },
new MultipleAxesChartData{ x= "Oct", y= 30, y1= 32 },
new MultipleAxesChartData{ x= "Nov", y= 35, y1= 32 },
new MultipleAxesChartData{ x= "Dec", y= 35, y1= 31 }
};
ViewBag.dataSource = chartData;
return View();
}
public class MultipleAxesChartData
{
public string x;
public double y;
public double
For spanning the horizontal axis along multiple column, you can use Span
property of an axis.
@Html.EJS().Chart("container").Columns(columns =>
{
columns.width("50%").Add();
columns.width("50%").Add();
})
.Series(series =>
{
series.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Column).XName("x").YName("y").DataSource(ViewBag.dataSource).Name("Germany").Add();
series.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Line).YAxisName("yAxis").XName("x").Marker(ViewBag.marker).YName("y1").DataSource(ViewBag.dataSource).Name("Japan").Add();
}).PrimaryXAxis(px => px.ValueType(Syncfusion.EJ2.Charts.ValueType.Category)
.Interval(1).LabelIntersectAction(Syncfusion.EJ2.Charts.LabelIntersectAction.Rotate90).Span(2)
).Axes(ax =>
{
ax.OpposedPosition(true).RowIndex(0).Minimum(24).Maximum(36).Interval(2).Name("yAxis").LabelFormat("{value}°C").Add();
}
)
).Title("Weather Condition JPN vs DEU").ChartArea(area => area.Border(ViewBag.ChartBorder)).Tooltip(tt => tt.Enable(true)).LegendSettings(lg=>lg.Visible(false)).Render()
public ActionResult Index()
{
List<MultipleAxesChartData> chartData = new List<MultipleAxesChartData>
{
new MultipleAxesChartData{ x= "Jan", y= 15, y1= 33 },
new MultipleAxesChartData{ x= "Feb", y= 20, y1= 31 },
new MultipleAxesChartData{ x= "Mar", y= 35, y1= 30 },
new MultipleAxesChartData{ x= "Apr", y= 40, y1= 28 },
new MultipleAxesChartData{ x= "May", y= 80, y1= 29 },
new MultipleAxesChartData{ x= "Jun", y= 70, y1= 30 },
new MultipleAxesChartData{ x= "Jul", y= 65, y1= 33 },
new MultipleAxesChartData{ x= "Aug", y= 55, y1= 32 },
new MultipleAxesChartData{ x= "Sep", y= 50, y1= 34 },
new MultipleAxesChartData{ x= "Oct", y= 30, y1= 32 },
new MultipleAxesChartData{ x= "Nov", y= 35, y1= 32 },
new MultipleAxesChartData{ x= "Dec", y= 35, y1= 31 }
};
ViewBag.dataSource = chartData;
return View();
}
public class MultipleAxesChartData
{
public string x;
public double y;
public double