- Title
- Title rotation
- Tick lines customization
- Grid lines customization
- Multiple axis
- Inversed axis
- Opposed position
Contact Support
Axis customization in ASP.NET CORE 3D Chart Component
9 Jan 202417 minutes to read
Title
The title for the axis can be added by using the Title
property. It helps to provide quick information to the user about the data plotted in the axis. Title style can be customized using TitleStyle
property of the axis.
<ejs-chart3d id="container" wallColor="transparent" enableRotation="true" rotation="7" tilt="10" depth="100">
<e-chart3d-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category" title="Countries">
<e-titlestyle size="16px" color="grey" fontFamily="Segoe UI" fontWeight="bold"></e-titlestyle>
</e-chart3d-primaryxaxis>
<e-chart3d-series-collection>
<e-chart3d-series dataSource="ViewBag.dataSource" xName="country" yName="gold"
type="@Syncfusion.EJ2.Charts.Chart3DSeriesType.Column"></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
public ActionResult Index()
{
List<ChartData> chartData = new List<ChartData>
{
new ChartData { country= "USA", gold= 50 },
new ChartData { country= "China", gold= 40 },
new ChartData { country= "Japan", gold= 70 },
new ChartData { country= "Australia", gold= 60 },
new ChartData { country= "France", gold= 50 },
new ChartData { country= "Germany", gold= 40 },
new ChartData { country= "Italy", gold= 40 },
new ChartData { country= "Sweden", gold= 30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ChartData
{
public string country;
public double gold;
}
Title rotation
The title can be rotated from 0 to 360 degree by using the TitleRotation
property.
<ejs-chart3d id="container" wallColor="transparent" enableRotation="true" rotation="7" tilt="10" depth="100">
<e-chart3d-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category" title="Countries" titleRotation="90">
<e-titlestyle size="16px" color="grey" fontFamily="Segoe UI" fontWeight="bold"></e-titlestyle>
</e-chart3d-primaryxaxis>
<e-chart3d-series-collection>
<e-chart3d-series dataSource="ViewBag.dataSource" xName="country" yName="gold"
type="@Syncfusion.EJ2.Charts.Chart3DSeriesType.Column"></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
public ActionResult Index()
{
List<ChartData> chartData = new List<ChartData>
{
new ChartData { country= "USA", gold= 50 },
new ChartData { country= "China", gold= 40 },
new ChartData { country= "Japan", gold= 70 },
new ChartData { country= "Australia", gold= 60 },
new ChartData { country= "France", gold= 50 },
new ChartData { country= "Germany", gold= 40 },
new ChartData { country= "Italy", gold= 40 },
new ChartData { country= "Sweden", gold= 30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ChartData
{
public string country;
public double gold;
}
Tick lines customization
The Width
, Color
and Height
of the minor and major tick lines can be customized by using the MajorTickLines
and MinorTickLines
properties in the axis.
<ejs-chart3d id="container" wallColor="transparent" enableRotation="true" rotation="7" tilt="10" depth="100">
<e-chart3d-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category">
<e-majorticklines color="blue" width="5"></e-majorticklines>
</e-chart3d-primaryxaxis>
<e-chart3d-series-collection>
<e-chart3d-series dataSource="ViewBag.dataSource" xName="country" yName="gold"
type="@Syncfusion.EJ2.Charts.Chart3DSeriesType.Column"></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
public ActionResult Index()
{
List<ChartData> chartData = new List<ChartData>
{
new ChartData { country= "USA", gold= 50 },
new ChartData { country= "China", gold= 40 },
new ChartData { country= "Japan", gold= 70 },
new ChartData { country= "Australia", gold= 60 },
new ChartData { country= "France", gold= 50 },
new ChartData { country= "Germany", gold= 40 },
new ChartData { country= "Italy", gold= 40 },
new ChartData { country= "Sweden", gold= 30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ChartData
{
public string country;
public double gold;
}
Grid lines customization
The Width
and Color
of the minor and major grid lines can be customized by using the MajorGridLines
and MinorGridLines
properties in the axis.
<ejs-chart3d id="container" wallColor="transparent" enableRotation="true" rotation="7" tilt="10" depth="100">
<e-chart3d-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category">
<e-majorgridlines color="blue" width="1"></e-majorgridlines>
</e-chart3d-primaryxaxis>
<e-chart3d-series-collection>
<e-chart3d-series dataSource="ViewBag.dataSource" xName="country" yName="gold"
type="@Syncfusion.EJ2.Charts.Chart3DSeriesType.Column"></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
public ActionResult Index()
{
List<ChartData> chartData = new List<ChartData>
{
new ChartData { country= "USA", gold= 50 },
new ChartData { country= "China", gold= 40 },
new ChartData { country= "Japan", gold= 70 },
new ChartData { country= "Australia", gold= 60 },
new ChartData { country= "France", gold= 50 },
new ChartData { country= "Germany", gold= 40 },
new ChartData { country= "Italy", gold= 40 },
new ChartData { country= "Sweden", gold= 30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ChartData
{
public string country;
public double gold;
}
Multiple axis
In addition to primary X and Y axis, n number of axis can be added to the chart. Series can be associated with this axis, by mapping with axis’s unique name.
<ejs-chart3d id="container" wallColor="transparent" enableRotation="true" rotation="7" tilt="10" depth="100">
<e-chart3d-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category">
</e-chart3d-primaryxaxis>
<e-chart3d-axes>
<e-chart3d-axis rowIndex="0" name="yAxis">
</e-chart3d-axis>
</e-chart3d-axes>
<e-chart3d-series-collection>
<e-chart3d-series dataSource="ViewBag.dataSource" xName="country" yName="gold"
type="@Syncfusion.EJ2.Charts.Chart3DSeriesType.Column"></e-chart3d-series>
<e-chart3d-series dataSource="ViewBag.dataSource" xName="country" yName="silver"
type="@Syncfusion.EJ2.Charts.Chart3DSeriesType.Column" yAxisName="yAxis"></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
public ActionResult Index()
{
List<ChartData> chartData = new List<ChartData>
{
new ChartData { country= "USA", gold= 50, silver= 70 },
new ChartData { country= "China", gold= 40, silver= 60 },
new ChartData { country= "Japan", gold= 70, silver= 60 },
new ChartData { country= "Australia", gold= 60, silver= 56 },
new ChartData { country= "France", gold= 50, silver= 45 },
new ChartData { country= "Germany", gold= 40, silver= 30 },
new ChartData { country= "Italy", gold= 40, silver= 35 },
new ChartData { country= "Sweden", gold= 30, silver= 25 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ChartData
{
public string country;
public double gold;
public double silver;
}
Inversed axis
When an axis is inversed, highest value of the axis comes closer to origin and vice versa. To place an axis in inversed manner, set the IsInversed
property to true.
<ejs-chart3d id="container" wallColor="transparent" enableRotation="true" rotation="7" tilt="10" depth="100">
<e-chart3d-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category" isInversed="true">
</e-chart3d-primaryxaxis>
<e-chart3d-primaryyaxis isInversed="true">
</e-chart3d-primaryyaxis>
<e-chart3d-series-collection>
<e-chart3d-series dataSource="ViewBag.dataSource" xName="country" yName="gold"
type="@Syncfusion.EJ2.Charts.Chart3DSeriesType.Column"></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
public ActionResult Index()
{
List<ChartData> chartData = new List<ChartData>
{
new ChartData { country= "USA", gold= 50 },
new ChartData { country= "China", gold= 40 },
new ChartData { country= "Japan", gold= 70 },
new ChartData { country= "Australia", gold= 60 },
new ChartData { country= "France", gold= 50 },
new ChartData { country= "Germany", gold= 40 },
new ChartData { country= "Italy", gold= 40 },
new ChartData { country= "Sweden", gold= 30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ChartData
{
public string country;
public double gold;
}
Opposed position
To place an axis opposite from its original position, set the OpposedPosition
property to true.
<ejs-chart3d id="container" wallColor="transparent" enableRotation="true" rotation="7" tilt="10" depth="100">
<e-chart3d-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category">
</e-chart3d-primaryxaxis>
<e-chart3d-primaryyaxis opposedPosition="true">
</e-chart3d-primaryyaxis>
<e-chart3d-series-collection>
<e-chart3d-series dataSource="ViewBag.dataSource" xName="country" yName="gold"
type="@Syncfusion.EJ2.Charts.Chart3DSeriesType.Column"></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
public ActionResult Index()
{
List<ChartData> chartData = new List<ChartData>
{
new ChartData { country= "USA", gold= 50 },
new ChartData { country= "China", gold= 40 },
new ChartData { country= "Japan", gold= 70 },
new ChartData { country= "Australia", gold= 60 },
new ChartData { country= "France", gold= 50 },
new ChartData { country= "Germany", gold= 40 },
new ChartData { country= "Italy", gold= 40 },
new ChartData { country= "Sweden", gold= 30 }
};
ViewBag.dataSource = chartData;
return View();
}
public class ChartData
{
public string country;
public double gold;
}