RunTimeStatisticView.xaml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <UserControl x:Class="Aitex.UI.Charting.View.RunTimeStatisticView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:sciChart="http://schemas.abtsoftware.co.uk/scichart"
  7. mc:Ignorable="d"
  8. d:DesignHeight="408" d:DesignWidth="880" FontFamily="Arial,SimSun" FontSize="11">
  9. <Grid x:Name="grid1">
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="auto" />
  12. <RowDefinition Height="400*" />
  13. </Grid.RowDefinitions>
  14. <StackPanel Grid.Row="0" Height="22" Orientation="Horizontal" Background="LightGray">
  15. <Button Width="75" BorderThickness="0.1" Padding="0" IsTabStop="False" Focusable="False" Command="{Binding Show1YearCommand}"
  16. ToolTip="查看最近一年的设备运行情况">
  17. <Button.Content>
  18. <StackPanel Orientation="Horizontal">
  19. <Image Source="/DataAnalysisControl;component/Charting/Images/Zoom_All.png" Stretch="Fill" Height="19" Width="19" HorizontalAlignment="Left" />
  20. <Label Content=" 最近一年" VerticalContentAlignment="Center" Padding="0" />
  21. </StackPanel>
  22. </Button.Content>
  23. </Button>
  24. <Button Width="75" BorderThickness="0.1" Padding="0" IsTabStop="False" Focusable="False" Command="{Binding ShowAllCommand}"
  25. ToolTip="查看全部时间段的设备运行情况">
  26. <Button.Content>
  27. <StackPanel Orientation="Horizontal">
  28. <Image Source="/DataAnalysisControl;component/Charting/Images/Zoom_All.png" Stretch="Fill" Height="19" Width="19" HorizontalAlignment="Left" />
  29. <Label Content=" 全部时间" VerticalContentAlignment="Center" Padding="0" />
  30. </StackPanel>
  31. </Button.Content>
  32. </Button>
  33. </StackPanel>
  34. <Grid Grid.Row="1">
  35. <!-- Create the chart surface -->
  36. <sciChart:SciChartSurface Name="sciChart" sciChart:ThemeManager.Theme="BrightSpark" ClipToBounds="False" Padding="0">
  37. <!-- Declare RenderableSeries -->
  38. <sciChart:SciChartSurface.RenderableSeries>
  39. <sciChart:FastBandRenderableSeries SeriesColor="#55FF0000" Series1Color="#55FF0000" BandUpColor="#55FF0000" BandDownColor="#55FF0000" IsDigitalLine="False"/>
  40. <sciChart:FastBandRenderableSeries SeriesColor="#5500FF00" Series1Color="#5500FF00" BandUpColor="#5500FF00" BandDownColor="#5500FF00" IsDigitalLine="False"/>
  41. <sciChart:FastBandRenderableSeries SeriesColor="#555F5F00" Series1Color="#555F5F00" BandUpColor="#555F5F00" BandDownColor="#555F5F00" IsDigitalLine="False"/>
  42. <sciChart:FastBandRenderableSeries SeriesColor="#550000FF" Series1Color="#550000FF" BandUpColor="#550000FF" BandDownColor="#550000FF" IsDigitalLine="False"/>
  43. </sciChart:SciChartSurface.RenderableSeries>
  44. <!--
  45. <sciChart:SciChartSurface.RenderableSeries>
  46. <sciChart:FastLineRenderableSeries SeriesColor="Red">
  47. <sciChart:FastLineRenderableSeries.PointMarkerTemplate>
  48. <ControlTemplate>
  49. <Ellipse Width="8" Height="8" Fill="Red"/>
  50. </ControlTemplate>
  51. </sciChart:FastLineRenderableSeries.PointMarkerTemplate>
  52. </sciChart:FastLineRenderableSeries>
  53. <sciChart:FastLineRenderableSeries SeriesColor="DarkBlue">
  54. <sciChart:FastLineRenderableSeries.PointMarkerTemplate>
  55. <ControlTemplate>
  56. <Ellipse Width="8" Height="8" Fill="DarkBlue"/>
  57. </ControlTemplate>
  58. </sciChart:FastLineRenderableSeries.PointMarkerTemplate>
  59. </sciChart:FastLineRenderableSeries>
  60. <sciChart:FastLineRenderableSeries SeriesColor="DarkOrange">
  61. <sciChart:FastLineRenderableSeries.PointMarkerTemplate>
  62. <ControlTemplate>
  63. <Ellipse Width="8" Height="8" Fill="DarkOrange"/>
  64. </ControlTemplate>
  65. </sciChart:FastLineRenderableSeries.PointMarkerTemplate>
  66. </sciChart:FastLineRenderableSeries>
  67. <sciChart:FastLineRenderableSeries SeriesColor="DarkGreen">
  68. <sciChart:FastLineRenderableSeries.PointMarkerTemplate>
  69. <ControlTemplate>
  70. <Ellipse Width="8" Height="8" Fill="DarkGreen"/>
  71. </ControlTemplate>
  72. </sciChart:FastLineRenderableSeries.PointMarkerTemplate>
  73. </sciChart:FastLineRenderableSeries>
  74. </sciChart:SciChartSurface.RenderableSeries>
  75. -->
  76. <!-- Create an X Axis -->
  77. <sciChart:SciChartSurface.XAxis>
  78. <sciChart:DateTimeAxis AutoRange="Never" DrawMinorTicks="True" DrawMinorGridLines="True" Margin="0,0,0,0" SubDayTextFormatting="yyyy/MM/dd" TitleFontSize="10" TextFormatting="yyyy/MM/dd" AxisTitle="日期" MinorsPerMajor="1" />
  79. </sciChart:SciChartSurface.XAxis>
  80. <!-- Create a Y Axis -->
  81. <sciChart:SciChartSurface.YAxis>
  82. <sciChart:NumericAxis DrawMinorTicks="True" DrawMinorGridLines="True" AxisAlignment="Right" AxisTitle="运行时间 (小时)" MinorsPerMajor="1">
  83. <sciChart:NumericAxis.GrowBy>
  84. <sciChart:DoubleRange Min="0.1" Max="0.1"/>
  85. </sciChart:NumericAxis.GrowBy>
  86. </sciChart:NumericAxis>
  87. </sciChart:SciChartSurface.YAxis>
  88. <!-- Specify interactivity modifiers -->
  89. <sciChart:SciChartSurface.ChartModifier>
  90. <sciChart:ModifierGroup>
  91. <!-- Provides selection of series and custom styling to the selected series -->
  92. <sciChart:SeriesSelectionModifier>
  93. <sciChart:SeriesSelectionModifier.SelectedSeriesStyle>
  94. <Style TargetType="sciChart:BaseRenderableSeries">
  95. <Setter Property="SeriesColor" Value="Red"/>
  96. <Setter Property="PointMarkerTemplate">
  97. <Setter.Value>
  98. <ControlTemplate>
  99. <Ellipse Fill="#FFAA00AA" Stroke="Red" Width="8" Height="8"/>
  100. </ControlTemplate>
  101. </Setter.Value>
  102. </Setter>
  103. </Style>
  104. </sciChart:SeriesSelectionModifier.SelectedSeriesStyle>
  105. </sciChart:SeriesSelectionModifier>
  106. <sciChart:RubberBandXyZoomModifier IsEnabled="True"
  107. IsXAxisOnly="True"
  108. ZoomExtentsY="False"
  109. IsAnimated="True" ExecuteOn="MouseMiddleButton" />
  110. <sciChart:ZoomExtentsModifier ExecuteOn="MouseDoubleClick"/>
  111. <!-- Provides a data source for the legend control -->
  112. <sciChart:LegendModifier GetLegendDataFor="AllSeries" x:Name="legendModifier"/>
  113. <!--<sciChart:RubberBandXyZoomModifier IsEnabled="True" IsXAxisOnly="True"/>-->
  114. <!--<sciChart:CursorModifier IsEnabled="True"
  115. ShowAxisLabels="True"
  116. ShowTooltip="True" />-->
  117. <sciChart:ZoomPanModifier IsEnabled="True" ExecuteOn="MouseRightButton" XyDirection="XDirection" ZoomExtentsY="False" />
  118. <sciChart:MouseWheelZoomModifier XyDirection="XDirection"/>
  119. </sciChart:ModifierGroup>
  120. </sciChart:SciChartSurface.ChartModifier>
  121. </sciChart:SciChartSurface>
  122. <sciChart:SciChartLegend x:Name="legendControl" Visibility="Visible"
  123. Grid.Row="0" Margin="5,5" ShowVisibilityCheckboxes="True"
  124. LegendData="{Binding LegendData, ElementName=legendModifier, Mode=OneWay}"
  125. FontSize="10" FontWeight="Light" />
  126. </Grid>
  127. </Grid>
  128. </UserControl>