5
votes

like two guys before me there and second one there I have difficulty with 3D chart.

How to force them to be transparent like this picture: alt text

taken from 3D Area chart example shipped with ASP.NET Chart controls. This chart has ChartColorPalette.BrightPastel pallete, but is transparent.

I have also 3D chart with ChartColorPalette.BrightPastel palette, but is not transparent and I still cannot found way how to make it transparent like example chart. (After examining example markup and codebehind):

alt text

The only way I've found is to set the color of series with alpha channel for transparency, or use color palette with transparent colors (for example ChartColorPalette.SemiTransparent) but there must be some other default way which I'm missing.

Reason I really need this to know is that I'm creating graphs without any code behind just using markup, so I'm finding it a little bit redundant to create code snippets only because of this.

Thank you very much for any answers.

Edit: I'm using .NET 3.5 version of ASP.NET charts.

3
I can't even get it in 3D. I enabled 3D but it doesn't draw 3D, just the same flat chart.Jeroen

3 Answers

1
votes

I see you're on this thread too. Unfortunately, you do need to use colors with an alpha channel in order to set transparency AFAIK

Here's a good overview of the palettes available and some basics on manipulating them

My guess is that you could create a new palette by iterating over the colors in the bright pastel palette and adding an alpha channel - if you do this in a global static, perhaps as part of your webapp init logic, you should be able to reference it pretty easily - if you don't want to have any codebehind, you ?may? be able to databind your custom palette to the CustomPalette property, but I can't say with certainty.

1
votes

I'd same problem here. Solved using this:

// After all series manipulation, add this
chart.ApplyPaletteColors();
foreach (var serie in chart.Series)
    serie.Color = Color.FromArgb(220, serie.Color);
1
votes

If you do use palette, and not one color per series, you have to set color for every point:

myChart.ApplyPaletteColors();

foreach (var series in myChart.Series)
{
    foreach (var point in series.Points)
    {
        point.Color = Color.FromArgb(220, point.Color);
    }
}