)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to change the font in X/Y axis in Pivot Chart ?

Platform: jQuery |
Control: ejPivotClient |
Published Date: March 12, 2015 |
Last Revised Date: June 18, 2019

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>

 

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon