How to give Style to WPF Toolkit Chart

前端 未结 2 1807
青春惊慌失措
青春惊慌失措 2021-02-06 13:49

\"enter

I am using WPF Toolkit Chart with PieChart in my WPF Application.

I want t

2条回答
  •  野性不改
    2021-02-06 14:16

    WPF was designed to allow you to style controls through XAML; not code. Making the plot area and legend transparent in a pie chart is also possible through styling. Unfortunately, the border around the plot area cannot be controlled using a property and instead you have to modify the entire control template. In the end using styling is probably just as tedious as writing code behind that modifies the visual tree, but to me at least, it still feels like a cleaner approach.

    
      
        
      
    
      
        
      
    
      
        
      
    
      
    
    

    The PlotAreaStyle and LegendStyle are modified to make them transparent. The border around the plot area is removed by modifying the ControlTemplate of the chart and simply commenting out the offending Border element.

提交回复
热议问题