2017-11-27 6 views
0

내 차트의 x 축을 숨길 수있는 간단한 방법이 있습니까? XAML을 사용하여 비활성화하려고합니다.x 축 UWP 차트 숨기기

이것은 X 및 Y 축을 표시하는 현재 XAML 코드입니다. stackoverflow 일부 솔루션을 시도했지만 그들 중 누구도 나를 위해 일했다.

<Charting:Chart x:Name="LineChart" Margin="0,100,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="800" Height="400"> 
    <Charting:LineSeries Name="line_data" Margin="0" IndependentValuePath="Key" DependentValuePath="Value" IsSelectionEnabled="True"/> 
</Charting:Chart> 
+0

아마도 Chart의 템플릿을 편집하고 레이블 요소를 제거 할 수 있습니다. 그런 다음이 템플릿을 스타일로 적용하여 차트에 적용 할 수 있습니다. – Anton

+0

@Anton 내가 예를 보여 주시겠습니까? – stickfigure4

답변

0

숨기기 X 축 UWP 차트

x-Axis 실제로 차트에서 CategoryAxis입니다. 스타일을 재정 의하여 CategoryAxis 콘텐츠를 삭제할 수 있습니다. 예를 들어 :

<Page.Resources> 
    <Style TargetType="Charting:CategoryAxis">  
     <Setter Property="Template"> 
      <Setter.Value> 
       <ControlTemplate TargetType="Charting:CategoryAxis"> 
        <!--<Grid x:Name="AxisGrid" Background="{TemplateBinding Background}"> 
         <dataVis:Title x:Name="AxisTitle" Style="{TemplateBinding TitleStyle}" Visibility="Collapsed"/> 
        </Grid>--> 
       </ControlTemplate> 
      </Setter.Value> 
     </Setter> 
    </Style> 
</Page.Resources> 

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" DataContext="{Binding}"> 
    <Charting:Chart 
     Title="{Binding Title}" 
     Width="600" 
     Height="400" 
     HorizontalAlignment="Center" 
     VerticalAlignment="Center" 
     DataContext="{Binding}" >  
     <Charting:LineSeries 
      Title="Title" 
      Margin="0" 
      DependentValuePath="Amount" 
      IndependentValuePath="Name" 
      IsSelectionEnabled="True" 
      ItemsSource="{Binding Data}" /> 
    </Charting:Chart> 
</Grid> 

당신은 CategoryAxishere의 완성 된 기본 스타일을 찾을 수 있고 당신이 원하는대로 변경합니다.

+0

@ stickfigure4, 모든 업데이트? –