PageRenderTime 30ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/Main/src/Xbap/DynamicDataDisplay.Xbap.Samples/Demos/v04/Markers/BarChart page/BarChartPage.xaml

#
XAML | 55 lines | 51 code | 4 blank | 0 comment | 0 complexity | 9c056a7d75ef8c4ebd5d667960b4640b MD5 | raw file
Possible License(s): CC-BY-SA-3.0
  1. <Page x:Class="NewMarkersSample.Pages.BarChartPage"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"
  5. xmlns:local="clr-namespace:NewMarkersSample.Pages" Loaded="Page_Loaded"
  6. Title="Bar Chart">
  7. <Grid>
  8. <Grid.RowDefinitions>
  9. <RowDefinition Height="*"/>
  10. <RowDefinition Height="Auto"/>
  11. </Grid.RowDefinitions>
  12. <d3:ChartPlotter Name="plotter" Visible="-1,-0.1 11,5">
  13. <d3:ChartPlotter.Resources>
  14. <local:HeightToFillConverter x:Key="converter"/>
  15. <local:TooltipConverter FormatString="[0:F2]: [1:F2]->[2:F2]" x:Key="tooltipConverter"/>
  16. <d3:BrushHSBConverter SaturationDelta="0.8" LightnessDelta="1.6" x:Key="lighterConverter"/>
  17. <d3:BackgroundToForegroundConverter x:Key="backToForeConv"/>
  18. </d3:ChartPlotter.Resources>
  19. <d3:BarChart Name="barChart">
  20. <d3:TemplateMarkerGenerator>
  21. <DataTemplate>
  22. <Rectangle Width="30" Fill="{Binding YMax, Converter={StaticResource converter}}"
  23. d3:ViewportPanel.Y="{Binding YMin}"
  24. d3:ViewportPanel.X="{Binding X}"
  25. d3:ViewportPanel.ViewportHeight="{Binding YMax}"
  26. d3:ViewportPanel.ViewportVerticalAlignment="Bottom">
  27. <d3:LiveToolTipService.ToolTip>
  28. <d3:LiveToolTip BorderBrush="DarkGray" Background="{d3:SelfBinding Path=Owner.Fill, Converter={StaticResource lighterConverter}}"
  29. TextBlock.Foreground="{d3:SelfBinding Path=Owner.Fill, Converter={StaticResource backToForeConv}}">
  30. <TextBlock>
  31. <TextBlock.Text>
  32. <MultiBinding Converter="{StaticResource tooltipConverter}">
  33. <Binding Path="X"/>
  34. <Binding Path="YMin"/>
  35. <Binding Path="YMax"/>
  36. </MultiBinding>
  37. </TextBlock.Text>
  38. </TextBlock>
  39. </d3:LiveToolTip>
  40. </d3:LiveToolTipService.ToolTip>
  41. </Rectangle>
  42. </DataTemplate>
  43. </d3:TemplateMarkerGenerator>
  44. </d3:BarChart>
  45. <Grid Canvas.Top="10" Canvas.Left="10">
  46. <Rectangle RadiusX="2" RadiusY="2" Stroke="LightGray" StrokeThickness="1" Fill="White" Opacity="0.7"/>
  47. <TextBlock Margin="5" FontSize="14">Try to move <Run Foreground="Green">mouse</Run> over animated bars.</TextBlock>
  48. </Grid>
  49. </d3:ChartPlotter>
  50. </Grid>
  51. </Page>