How to change the font in X/Y axis in JavaScript Pivot Chart ?
This KB illustrates that how to change the font in X/Y axis in Pivot Chart.
Solution:
You can change the font in X-axis and Y-axis with respective to JS, ASP and MVC platforms of PivotChart control by using the following code examples.
JS
$(function () { $("#PivotChart1").ejPivotChart({ url: "../wcf/OlapChartService.svc", legend: { visible: true, rowCount: 3 }, commonSeriesOptions: { type: ej.PivotChart.ChartTypes.Column }, primaryXAxis: { title: { text: "Primary X title customization", font: { color: 'red', fontFamily: 'Segoe UI', fontStyle: 'Italic', size: '18px', opacity: 1, fontWeight: 'lighter' } } }, primaryYAxis: { title: { text: "Primary Y title customization", font: { color: 'red', fontFamily: 'Segoe UI', fontStyle: 'Italic', size: '18px', opacity: 1, fontWeight: 'lighter' } } } }); });
MVC
@Html.EJ().Pivot().PivotChart("PivotChart1").Url("../wcf/OlapChartService.svc").CommonSeriesOptions(comm => comm.Type(SeriesType.Column)).PrimaryXAxis(primaryXAxis =>primaryXAxis.Title(title=>title.Text("Primary X title customization").Font(font=>font.Color("red").FontFamily("Segoe UI").FontStyle(ChartFontStyle.Italic).Size("18px").Opacity(1).FontWeight(ChartFontWeight.Lighter)))).PrimaryYAxis(primaryYAxis =>primaryYAxis.Title(title=>title.Text("Primary Y title customization").Font(font=>font.Color("red").FontFamily("Segoe UI").FontStyle(ChartFontStyle.Italic).Size("18px").Opacity(1).FontWeight(ChartFontWeight.Lighter))))
ASP
<ej:PivotChart ID="PivotChart1" runat="server" Url="../wcf/OlapChartService.svc"> <primaryxaxis Title-Text="Primary X title customization" Title-Font-Color="red" Title-Font-FontFamily="Segoe UI" Title-Font-FontStyle="Italic" Title-Font-FontSize="18px" Title-Font-Opacity=1 Title-Font-FontWeight="lighter"/> <primaryyaxis Title-Text="Primary Y title customization" Title-Font-Color="red" Title-Font-FontFamily="Segoe UI" Title-Font-FontStyle="Italic" Title-Font-FontSize="18px" Title-Font-Opacity=1 Title-Font-FontWeight="lighter"/> </ej:PivotChart>
Conclusion
I hope you enjoyed learning about how to change the font in X/Y axis in JavaScript Pivot Chart.
You can refer to our JavaScript
PivotChart feature tour
page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration
specifications.
You can also explore our JavaScript
PivotChart example
to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!