下面是页面代码

<UserControl xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"  x:Class="SilverlightApplication2.MainPage"
    xmlns
="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x
="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d
="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc
="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable
="d"
               xmlns:local
="clr-namespace:SilverlightApplication2"
    d:DesignHeight
="300" d:DesignWidth="400" >

    
<Grid x:Name="LayoutRoot" Background="White">
        
<Grid.Resources>
            
<local:EngineMeasurementCollection x:Key="EngineMeasurementCollection"/>
        
</Grid.Resources>
        
<toolkit:Chart>
            
<!-- Power curve  -->
            
<toolkit:LineSeries
                            
Title="Power"
                           ItemsSource
="{StaticResource EngineMeasurementCollection}"
                            IndependentValueBinding
="{Binding Speed}"
                            DependentValueBinding
="{Binding Power}">
                
<!--MarkerWidth="5"
                            MarkerHeight="5"
-->
                
<!-- Vertical axis for power curve  Orientation="Vertical"-->
                
<toolkit:LineSeries.DependentRangeAxis>

                    
<toolkit:LinearAxis
                         
                                     
Orientation="y"
                                    Title
="Power (hp)"
                                    Minimum
="0"
                                    Maximum
="250"
                                    Interval
="50"
                                    ShowGridLines
="True"/>
                
</toolkit:LineSeries.DependentRangeAxis>
            
</toolkit:LineSeries>
            
<toolkit:ColumnSeries   Title="Power"
                           ItemsSource
="{StaticResource EngineMeasurementCollection}"
                            IndependentValueBinding
="{Binding Speed}"
                            DependentValueBinding
="{Binding Power}">
                
<toolkit:ColumnSeries.DependentRangeAxis>
                    
<toolkit:LinearAxis    Orientation="y"
                                    Title
="Power (hp)"
                                    Minimum
="0"
                                    Maximum
="250"
                                    Interval
="50"
                                    ShowGridLines
="True"></toolkit:LinearAxis>
                
</toolkit:ColumnSeries.DependentRangeAxis>
            
</toolkit:ColumnSeries>
            
<!-- Torque curve  -->
            
<toolkit:LineSeries
                            
Title="Torque"
                           ItemsSource
="{StaticResource EngineMeasurementCollection}"
                            IndependentValueBinding
="{Binding Speed}"
                            DependentValueBinding
="{Binding Torque}">
                
<!--MarkerWidth="5"-->
                
<!--MarkerHeight="5"-->
                
<!-- Vertical axis for torque curve  Orientation="Vertical"-->
                
<toolkit:LineSeries.DependentRangeAxis>
                    
<toolkit:LinearAxis
                                   
Orientation="Y"
                                    Title
="Torque (lb-ft)"
                                    Minimum
="50"
                                    Maximum
="300"
                                    Interval
="50"/>
                
</toolkit:LineSeries.DependentRangeAxis>
            
</toolkit:LineSeries>
            
<toolkit:Chart.Axes>
                
<!-- Shared horizontal axis Orientation="Horizontal"-->
                
<toolkit:LinearAxis
                                
Orientation="X"
                                Title
="Speed (rpm)"
                                Interval
="1000"
                                ShowGridLines
="True"/>
            
</toolkit:Chart.Axes>
        
</toolkit:Chart>
    
</Grid>
</UserControl>

相关文章:

  • 2021-11-28
  • 2021-11-27
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2021-12-08
  • 2021-12-08
  • 2021-05-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2021-05-03
  • 2021-11-13
  • 2021-12-08
相关资源
相似解决方案