1

我正在使用 WPF Toolkit 中的 AreaSeries 来实现类似堆叠区域的功能。但这对于 WPF 工具包实际上是不可能的,所以我将简单地绘制两个系列,而后面的一个是前面系列和“堆叠”一个系列的总和。因此,该系列的不透明度应为 100%。但是虽然我将所有可能的不透明度都设置为 1.0,但该系列仍然有点透明。那么,有谁知道,秘密开关在哪里?

这是一个片段,所以你可以看到我已经在哪里设置了不透明度,但没有效果......

Dim col As System.Windows.Media.Color
col = System.Windows.Media.ColorConverter.ConvertFromString("#ff00ff00")
Dim brush As System.Windows.Media.Brush = New SolidColorBrush(col)
brush.Opacity = 1.0
series.Background = brush
series.Opacity = 1.0
series.Background.Opacity = 1.0
4

1 回答 1

1
  <ch:Chart Margin="56,21,50,72" Title="MyChart" DataContext="{Binding ElementName=Window, Mode=OneWay}"  Style="{StaticResource controlStyle}" >

                    <ch:AreaSeries Name="DefaultArea" ItemsSource="{Binding Path=Key}" IndependentValueBinding="{Binding Key}" DependentValueBinding="{Binding Value}" Opacity="1" Title="111111" >
                        <ch:AreaSeries.Style>
                            <Style TargetType="ch:AreaSeries">
                                <Setter Property="IsTabStop" Value="False"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ch:AreaSeries">
                                            <Canvas x:Name="PlotArea">
                                                <Path Data="{TemplateBinding Geometry}" StrokeThickness="3" Fill="Pink" Style="{TemplateBinding PathStyle}" Opacity="1" />
                                            </Canvas>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </ch:AreaSeries.Style>
                    </ch:AreaSeries>

                    <ch:AreaSeries Name="PersonnelArea" ItemsSource="{Binding Path=Key}" IndependentValueBinding="{Binding Key}" DependentValueBinding="{Binding Value}" Opacity="1" >
                        <ch:AreaSeries.Style>
                            <Style TargetType="ch:AreaSeries">
                                <Setter Property="IsTabStop" Value="False"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ch:AreaSeries">
                                            <Canvas x:Name="PlotArea">
                                                <Path Data="{TemplateBinding Geometry}" StrokeThickness="3" Fill="Yellow" Style="{TemplateBinding PathStyle}" Opacity="1" />
                                            </Canvas>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </ch:AreaSeries.Style>

                    </ch:AreaSeries>  
                </ch:Chart>
于 2013-07-08T07:41:49.493 回答