ASP.NET 图表控件默认 3D 图表透明度?

发布于 2024-09-13 00:59:57 字数 1045 浏览 2 评论 0原文

就像我之前的两个人那里和第二个那里我对 3D 图表有困难。

如何强制它们像下图一样透明: 替代文本

取自 ASP.NET 图表控件附带的 3D 面积图示例。该图表具有 ChartColorPalette.BrightPastel 调色板,但是透明的。

我还有带有 ChartColorPalette.BrightPastel 调色板的 3D 图表,但不透明,而且我仍然找不到如何使其像示例图表一样透明的方法。 (检查示例标记和代码隐藏后):

替代文字

我发现的唯一方法是设置具有 alpha 通道透明度的系列颜色,或使用具有透明颜色的调色板(例如 ChartColorPalette.SemiTransparent),但必须有其他一些默认方式我失踪了。

我真正需要知道这一点的原因是,我正在创建图表,而无需任何代码隐藏,仅使用标记,因此我发现仅因此而创建代码片段有点多余。

非常感谢您的任何答复。

编辑:我正在使用 .NET 3.5 版本的 ASP.NET 图表。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

南渊 2024-09-20 00:59:57

我这里也有同样的问题。使用这个解决:

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

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);
沦落红尘 2024-09-20 00:59:57

如果您确实使用调色板,而不是每个系列使用一种颜色,则必须为每个点设置颜色:

myChart.ApplyPaletteColors();

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

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);
    }
}
薄荷港 2024-09-20 00:59:57

我发现您也在主题中。不幸的是,您确实需要使用带有 Alpha 通道的颜色来设置透明度 AFAIK

这里对可用调色板的一个很好的概述以及一些操作它们的基础知识

我的猜测是你可以通过迭代明亮的柔和调色板中的颜色并添加 alpha 通道来创建一个新调色板 - 如果你在全局静态中执行此操作,也许作为你的 web 应用程序初始化逻辑的一部分,你应该能够很容易地引用它 -如果您不想有任何代码隐藏,您可以吗?能够将自定义调色板数据绑定到 CustomPalette 属性,但我不能肯定地说。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文