2012-03-25 74 views
0

我想製作一個沒有圖例的光滑而漂亮的圖形,因爲它解釋了它自己(圖表)。如何隱藏圖例?

我該如何隱藏它?我已經嘗試了相同的方法,以使plotarea透明:

    <charting:Chart.PlotAreaStyle> 
         <Style TargetType="Grid"> 
          <Setter Property="Background" Value="Transparent" /> 
         </Style> 
        </charting:Chart.PlotAreaStyle> 

如何隱藏圖例,以同樣的方式?

回答

7

我發現我可以通過諸如下列設置圖表的LegendStyleStyle隱藏圖表圖例:

 <charting:Chart.LegendStyle> 
      <Style TargetType="FrameworkElement"> 
       <Setter Property="Width" Value="0" /> 
      </Style> 
     </charting:Chart.LegendStyle> 

奇怪的是,設置VisibilityCollapsed不起作用 - 傳說中仍然出現在運行時。

+1

它工作得很好,謝謝指出FrameworkElement。您可以使用 Jason94 2012-03-26 17:38:35

+0

可見性=在SL 5.0中爲我摺疊工作 – Rashack 2014-06-24 06:54:15