回复 3楼lufq的帖子
Y 轴设置方法请参考源码:
- <Window xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" x:Class="_11684.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- Title="MainWindow" Height="350" Width="525">
- <Window.Resources>
- <DataTemplate x:Key="tt">
- <StackPanel Orientation="Vertical">
- <TextBlock TextAlignment="Center" FontSize="14" FontWeight="Bold" Width="10" TextWrapping="Wrap" Text="{ Binding DataObject}" />
- </StackPanel>
- </DataTemplate>
- <DataTemplate x:Key="ty">
- <StackPanel Orientation="Vertical">
- <TextBlock TextAlignment="Center" FontSize="14" FontWeight="Bold" Width="15" TextWrapping="Wrap" Text="{ Binding DataObject}" />
- </StackPanel>
- </DataTemplate>
- </Window.Resources>
- <Grid>
- <c1:C1Chart Name="c1chart1" Margin="0,0,10,83">
- <c1:C1Chart.View>
- <c1:ChartView>
- <c1:ChartView.AxisX>
- <c1:Axis AnnoTemplate="{StaticResource tt}"></c1:Axis>
- </c1:ChartView.AxisX>
- <c1:ChartView.AxisY>
- <c1:Axis AnnoTemplate="{StaticResource ty}"></c1:Axis>
- </c1:ChartView.AxisY>
- </c1:ChartView>
- </c1:C1Chart.View>
- <c1:C1Chart.Data>
- <c1:ChartData ItemNames="杭州市 P2 P3 P4 P5">
- <c1:DataSeries Label="Series 1" RenderMode="Default" Values="20 22 19 24 25"/>
- <c1:DataSeries Label="Series 2" RenderMode="Default" Values="8 12 10 12 15"/>
- </c1:ChartData>
- </c1:C1Chart.Data>
- <c1:C1ChartLegend/>
- </c1:C1Chart>
- </Grid>
- </Window>
复制代码 |