2013-06-03 2 views
0

나는이 BubbleChart을 가지고 있는데, 여기에 을 추가하여 ToolTip을 표시하려고합니다. 내가이 작업을 수행함에 따라 ToolTip이 있었고 두 번째 시리즈를 추가 할 때까지는 문제가 없었습니다. 이전의 컬러 설정 (각 시리즈의 다른 색상)이 사라지고 각 시리즈의 색상이 동일 해졌습니다. 누군가가 시리즈의 기본 색상을 묶는 것을 알고 있습니까?여러 차트 스타일 지정 - 개별 색상

나는 Template Binding을 시도했지만 작동하지 않습니다.

<Style x:Key="BubbleToolTipTemplate" TargetType="{x:Type c:BubbleDataPoint}"> 
    <Setter Property="Template"> 
     <Setter.Value> 
      <ControlTemplate TargetType="c:BubbleDataPoint"> 
       <Grid RenderTransformOrigin=".5,.5"> 
        <Grid.RenderTransform> 
         <ScaleTransform ScaleX=".75" ScaleY=".75" /> 
        </Grid.RenderTransform> 

        <!-- This Ellipse should bind on the default color --> 
        <Ellipse Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" /> 
        <ContentPresenter Content="{TemplateBinding Size}" HorizontalAlignment="Center" VerticalAlignment="Center" /> 

        <ToolTipService.ToolTip> 
         <StackPanel> 
          <ContentControl Content ="{ TemplateBinding DependentValue, Converter={StaticResource DoubleToStringConverter}}" /> 
          <ContentControl Content ="{ TemplateBinding IndependentValue}"/> 
          <ContentControl Content ="{ TemplateBinding Size }" /> 
         </StackPanel> 
        </ToolTipService.ToolTip> 
       </Grid> 
      </ControlTemplate> 
     </Setter.Value> 
    </Setter> 
</Style> 

어쩌면 누군가가 이것을 처리했을 것입니다! 어떤 도움을 주셔서 감사합니다!

답변

0

좋아 해결책을 찾았습니다.

Background에는 Bubbleled Tablet의 기본 스타일을 찾을 수있는 generic.xaml이 있습니다 (찾을 수 있습니다. here).

Palette 리소스가있는 경우이 내용을 읽었습니다. 나중에 내가 트릭을 찾을 때까지 그 색상에 바인딩하려고!

타원의 채우기 속성을 {DynamicResource Background}로 설정하면됩니다. "!