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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize the font size, font style and text alignment of PivotChart title?

Platform: JavaScript |
Control: ejPivotChart |
Published Date: February 9, 2015 |
Last Revised Date: June 18, 2019

This KB illustrates that how to customize PivotChart title.

Solution:

You can customize the font size, font style and text alignment of PivotChart title by using the following code examples.

JS

$(function () {
   $("#PivotChart1").ejPivotChart({
      url: "../wcf/OlapChartService.svc", title: {
      text: "PivotChart in Essential Studio"
      }, load: "load"
   });
});
function load(args) {
   this.model.title.font.size = "30px",
   this.model.title.font.fontStyle = "italic",
   this.model.title.font.fontWeight = "bold",
   this.model.title.textAlignment = "center"
}

 

MVC

@Html.EJ().Pivot().PivotChart("PivotChart1").Url("../wcf/OlapChartService.svc").Title(title => title.Text("PivotChart in Essential Studio")).ClientSideEvents(oEve => { oEve.Load("load"); })
<script type="text/javascript">
    function load(args) {
        this.model.title.font.size = "30px",
        this.model.title.font.fontStyle = "italic",
        this.model.title.font.fontWeight = "bold",
        this.model.title.textAlignment = "center" 
    }
</script>

 

ASP.NET

<ej:PivotChart ID="PivotChart1" runat="server" Url="../wcf/OlapChartService.svc" title-text="PivotChart in Essential Studio">
         <ClientSideEvents Load="load" />
</ej:PivotChart>
<script type="text/javascript">
        function load(args) {
            this.model.title.font.size = "30px",
            this.model.title.font.fontStyle = "italic",
            this.model.title.font.fontWeight = "bold",
            this.model.title.textAlignment = "center"
        }
</script>

 

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.

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