不知道 WPF toolkit 控件 当鼠标移动到数值图形栏或者图像点的时候显示 X和Y的坐标值? 200
1个回答
展开全部
我给你DataPointStyle的样式吧。思路是用blend编辑Series的DataPointStyle。修改DataPoint模板中的Tooltip。
<Style x:Key="LineDataPointStyle1" TargetType="{x:Type dc:LineDataPoint}">
<Setter Property="Background" Value="Orange"/>
<Setter Property="BorderBrush" Value="Gray"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Width" Value="8"/>
<Setter Property="Height" Value="8"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type dc:LineDataPoint}">
<Grid x:Name="Root" Opacity="0">
<Grid.ToolTip>
<!--<ContentControl Content="{TemplateBinding FormattedDependentValue}"/>-->
<StackPanel Orientation="Horizontal">
<ContentControl Content="{TemplateBinding ActualIndependentValue}"/>
<TextBlock>,</TextBlock>
<ContentControl Content="{TemplateBinding ActualDependentValue}"/>
</StackPanel>
</Grid.ToolTip>
<Ellipse Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}"/>
<Ellipse RenderTransformOrigin="0.661,0.321">
<Ellipse.Fill>
<RadialGradientBrush GradientOrigin="0.681,0.308">
<GradientStop Color="Transparent"/>
<GradientStop Color="#FF3D3A3A" Offset="1"/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
<Ellipse x:Name="SelectionHighlight" Fill="Red" Opacity="0"/>
<Ellipse x:Name="MouseOverHighlight" Fill="White" Opacity="0"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
注释行是默认的toolitp中的内容。
<Style x:Key="LineDataPointStyle1" TargetType="{x:Type dc:LineDataPoint}">
<Setter Property="Background" Value="Orange"/>
<Setter Property="BorderBrush" Value="Gray"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Width" Value="8"/>
<Setter Property="Height" Value="8"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type dc:LineDataPoint}">
<Grid x:Name="Root" Opacity="0">
<Grid.ToolTip>
<!--<ContentControl Content="{TemplateBinding FormattedDependentValue}"/>-->
<StackPanel Orientation="Horizontal">
<ContentControl Content="{TemplateBinding ActualIndependentValue}"/>
<TextBlock>,</TextBlock>
<ContentControl Content="{TemplateBinding ActualDependentValue}"/>
</StackPanel>
</Grid.ToolTip>
<Ellipse Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}"/>
<Ellipse RenderTransformOrigin="0.661,0.321">
<Ellipse.Fill>
<RadialGradientBrush GradientOrigin="0.681,0.308">
<GradientStop Color="Transparent"/>
<GradientStop Color="#FF3D3A3A" Offset="1"/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
<Ellipse x:Name="SelectionHighlight" Fill="Red" Opacity="0"/>
<Ellipse x:Name="MouseOverHighlight" Fill="White" Opacity="0"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
注释行是默认的toolitp中的内容。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询