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 do you change the chart's background color?

Thread ID:

Created:

Updated:

Platform:

Replies:

126958 Oct 18,2016 06:15 PM UTC Oct 19,2016 07:23 AM UTC JavaScript 1
loading
Tags: ejChart
Cristian Scutaru
Asked On October 18, 2016 06:15 PM UTC

I called $("chart").ejChart({ background: "#FFFF00", ... }) and it works. But the color is not really a plain yellow! 

It looks like another internal parameter (alpha, opacity?) is set by default to something else. 

I don't see any other background color related property in the spec. So what else should I use to get an actual plain yellow?

Thanks,
Cris

Anandaraj T [Syncfusion]
Replied On October 19, 2016 07:23 AM UTC

Hi Cristian, 

Thanks for using Syncfusion products. 

As you mentioned, opacity is applied to the chart background by default. We can customize the opacity of chart background using the opacity option in chart border. The default value of opacity is 0.3

Since opacity of background color should not be customized through chart border, we have logged an improvement task. This will be included in our upcoming service pack release (Essential Studio 2016 volume 3 Service Pack 1) which is expected to be rolled out by the end of October 2016. 

We have also created a support incident under your direct trac account in the following link for better follow up 

Note: The following solution will work up to current version (Essential Studio 2016 Volume 3) and it may break from our next service pack version (Essential Studio 2016 Volume 3 Service Pack 1). 

We have prepared a simple sample to customize the opacity of background color in the following link 
JS Playground Sample link: http://jsplayground.syncfusion.com/5xvtqt03 

Please refer the following code snippet to customize chart background and opacity 

[JS] 
 
$("container").ejChart({ 
 
    //Background color of Chart 
    background: "#FFFF00", 
 
    border: { 
        //Background and border opacity of Chart. Default value is 0.3 
        opacity: 1 
    }, 
 
    //Other chart options 
}); 

Please let us know if you have any concern. 

Regards, 
Anand 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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

;