PageRenderTime 37ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/Main/src/Xbap/DynamicDataDisplay.Xbap.Samples/Demos/v04/Markers/ColumnChartSample.xaml

#
XAML | 63 lines | 59 code | 4 blank | 0 comment | 0 complexity | 85d1022a11948ef1edd0b2d0275ae1e8 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
  1. <Page x:Class="NewMarkersSample.Pages.ColumnChartSample"
  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. Title="Column chart" Loaded="Page_Loaded">
  6. <Grid>
  7. <Grid.Resources>
  8. <d3:BrushHSBConverter SaturationDelta="0.8" LightnessDelta="1.6" x:Key="lighterConverter"/>
  9. <d3:BackgroundToForegroundConverter x:Key="backToForeConv"/>
  10. </Grid.Resources>
  11. <Grid.ColumnDefinitions>
  12. <ColumnDefinition/>
  13. <ColumnDefinition/>
  14. </Grid.ColumnDefinitions>
  15. <d3:ChartPlotter Name="plotter" Visible="0,0,100,1">
  16. <d3:ColumnChart Name="chart" ItemsSource="{Binding}">
  17. <d3:TemplateMarkerGenerator>
  18. <DataTemplate>
  19. <Rectangle Fill="{d3:SelfBinding (d3:PointChartBase.Index), Converter={StaticResource fillsConverter}}"
  20. d3:ViewportPanel.ViewportWidth="1">
  21. <d3:LiveToolTipService.ToolTip>
  22. <d3:LiveToolTip Background="{d3:SelfBinding Path=Owner.Fill, Converter={StaticResource lighterConverter}}"
  23. TextBlock.Foreground="{d3:SelfBinding Path=Owner.Fill, Converter={StaticResource backToForeConv}}">
  24. <TextBlock>
  25. <Run Text="X="/><TextBlock Text="{Binding Path=Owner.(d3:PointChartBase.Index), RelativeSource={RelativeSource Mode=FindAncestor, AncestorLevel=1, AncestorType={x:Type d3:LiveToolTip}}}"/>
  26. <Run Text="; Y="/><TextBlock Text="{Binding}"/>
  27. </TextBlock>
  28. </d3:LiveToolTip>
  29. </d3:LiveToolTipService.ToolTip>
  30. </Rectangle>
  31. </DataTemplate>
  32. </d3:TemplateMarkerGenerator>
  33. </d3:ColumnChart>
  34. <RepeatButton Name="addBtn" Content="Add value" Click="addBtn_Click" Canvas.Bottom="10" Canvas.Right="10"/>
  35. <RepeatButton Name="insertBtn" Content="Insert value" Click="insertBtn_Click" Canvas.Bottom="35" Canvas.Right="10"/>
  36. <RepeatButton Name="deleteBtn" Content="Delete first" Click="deleteBtn_Click" Canvas.Bottom="60" Canvas.Right="10"/>
  37. </d3:ChartPlotter>
  38. <d3:ChartPlotter Name="plotter2" Visible="0,0,1,100" Grid.Column="1">
  39. <d3:HorizontalColumnChart Name="chart2" ItemsSource="{Binding}">
  40. <d3:TemplateMarkerGenerator>
  41. <DataTemplate>
  42. <Rectangle Fill="DarkOrchid">
  43. <Rectangle.ToolTip>
  44. <TextBlock>
  45. <Run Text="X="/>
  46. <TextBlock>
  47. <TextBlock.Text>
  48. <Binding Path="(d3:PointChartBase.Index)" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorLevel=3, AncestorType={x:Type Rectangle}}"/>
  49. </TextBlock.Text>
  50. </TextBlock><Run Text="; Y="/><TextBlock Text="{Binding}"/>
  51. </TextBlock>
  52. </Rectangle.ToolTip>
  53. </Rectangle>
  54. </DataTemplate>
  55. </d3:TemplateMarkerGenerator>
  56. </d3:HorizontalColumnChart>
  57. </d3:ChartPlotter>
  58. </Grid>
  59. </Page>