0

Windows Phone 7 amCharts チャートの x 軸からラベルを削除する方法を知っている人はいますか? 簡単なはずですが、それを行う方法が見つかりません。

これまでのところ、次のものがあります。

<AmCharts_Windows_QuickCharts:SerialChart x:Name="chart1" DataSource="{Binding Data}" 
       CategoryValueMemberPath="Date" 
       AxisForeground="White"
       PlotAreaBackground="Black"
       GridStroke="DarkGray" 
       ScrollViewer.HorizontalScrollBarVisibility="Auto">
       <AmCharts_Windows_QuickCharts:SerialChart.Graphs>
           <AmCharts_Windows_QuickCharts:LineGraph ValueMemberPath="Value" Title="SomeTitle" Brush="Orange" />
       </AmCharts_Windows_QuickCharts:SerialChart.Graphs>
</AmCharts_Windows_QuickCharts:SerialChart>

前もって感謝します。

4

1 に答える 1

0

CategoryValueMemberPathSerialChart 定義からを削除することでそれを行うことができます

<AmCharts_Windows_QuickCharts:SerialChart x:Name="chart1" DataSource="{Binding Data}" 
   AxisForeground="White"
   PlotAreaBackground="Black"
   GridStroke="DarkGray" 
   ScrollViewer.HorizontalScrollBarVisibility="Auto">
   <AmCharts_Windows_QuickCharts:SerialChart.Graphs>
       <AmCharts_Windows_QuickCharts:LineGraph ValueMemberPath="Value" Title="SomeTitle" Brush="Orange" />
   </AmCharts_Windows_QuickCharts:SerialChart.Graphs>

MinimumCategoryGridStepを 0 に設定することもできます

ラベルではなく目盛りが必要な場合は、SerialChart のスタイルをオーバーライドする必要があります。

    <Style x:Key="CategoryAxisStyle1" TargetType="amq:CategoryAxis">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="amq:CategoryAxis">
                    <Grid Background="Transparent">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Rectangle x:Name="PART_AxisLine" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Stretch" Height="2" Grid.Row="0" VerticalAlignment="Top"/>
                        <Canvas x:Name="PART_TickPanel" Height="5" Grid.Row="1" VerticalAlignment="Stretch"/>
                        <Canvas x:Name="PART_ValuesPanel" HorizontalAlignment="Stretch" Grid.Row="2" VerticalAlignment="Stretch" Visibility="Collapsed"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SerialChartStyle1" TargetType="amq:SerialChart">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="amq:SerialChart">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <amq:ValueAxis x:Name="PART_ValueAxis" Foreground="{TemplateBinding AxisForeground}" HorizontalAlignment="Right" Margin="0,0,0,-2" Grid.Row="0" Canvas.ZIndex="100"/>
                            <amq:CategoryAxis x:Name="PART_CategoryAxis" Foreground="{TemplateBinding AxisForeground}" Grid.Row="1" Style="{StaticResource CategoryAxisStyle1}"/>
                            <Border Background="{TemplateBinding PlotAreaBackground}" Grid.Row="0">
                                <amq:ValueGrid x:Name="PART_ValueGrid" Foreground="{TemplateBinding GridStroke}"/>
                            </Border>
                            <Border x:Name="PART_GraphCanvasDecorator" Grid.Row="0">
                                <Canvas x:Name="PART_GraphCanvas" Background="Transparent"/>
                            </Border>
                            <amq:Legend x:Name="PART_Legend" HorizontalAlignment="Left" Margin="10,0,0,0" Grid.Row="0" Visibility="{TemplateBinding LegendVisibility}" VerticalAlignment="Top"/>
                            <Canvas Grid.Row="0">
                                <amq:Balloon x:Name="PART_Balloon" BorderBrush="{TemplateBinding AxisForeground}" BorderThickness="2" Visibility="Collapsed"/>
                            </Canvas>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
于 2012-06-12T22:41:06.633 に答える