Transparent chart control

Hi,

I added the sync fusion chart control on the transparent panel and placed above the image. The back color of the control always seems to be black. When I reduced the opacity(alpha) for the chart by 

chart.BackColor = Color.FromArgb(30,231,231,231);

 still I see the back color as black. Can you share the sample to make the chart as transparent by controlling the opacity. I tried variety of ways to make it transparent but not able to do so. Need your reply as soon as possible.

Thanks

2 Replies

VK Vijayabharathi K Syncfusion Team December 3, 2012 01:41 PM UTC

Hi Vignesh,

 

Thanks for using Syncfusion products.

 

If your intention is to apply transparent color to chart control, we suggest you to use the below code snippet to achieve this,

 

[C#]

    this.chartControl1.BackColor =  Color.Transparent;

    this.chartControl1.ChartInterior = new Syncfusion.Drawing.BrushInfo(Color.Transparent);

 

Please let us know if we misunderstood your query.

 

Regards,

Vijayabharathi



MA macronbell replied to Vijayabharathi K July 4, 2022 05:03 AM UTC

Transparency is a property outside the color itself, and it's also known as alpha component, You can't code transparent as pure RGB (Red-Green-Blue), but you can use the RGBA notation, in which you define the color + alpha channel together:

rgba(red, green, blue, alpha)

Where alpha defines the opacity as a number between 0.0 (fully transparent) and 1.0 (fully opaque)

color: rgba(255, 0, 0, 0.5); /* 0.5 is the transparency value */

There's also the HEXA notation ( #RRGGBBAA ) now supported on all major browsers, which is pretty much the same as RGBA color code but using hexadecimal notation instead of decimal. It's called HEXA ( HEX + Alpha ). It takes in 8 digits instead of 6. The last pair is Alpha. So the pattern of pairs is #RRGGBBAA. Having 4 digits also works: #RGBA.

color: #FF000080; /* red at 50% opacity */

Here the FF0000 is the color and 80 is the transparency. Where 80 is the hexadecimal equivalent of 50%.




Loader.
Up arrow icon