PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 2ms 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
 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
12		<Grid.ColumnDefinitions>
13			<ColumnDefinition/>
14			<ColumnDefinition/>
15		</Grid.ColumnDefinitions>
16
17		<d3:ChartPlotter Name="plotter" Visible="0,0,100,1">
18			<d3:ColumnChart Name="chart" ItemsSource="{Binding}">
19				<d3:TemplateMarkerGenerator>
20					<DataTemplate>
21						<Rectangle Fill="{d3:SelfBinding (d3:PointChartBase.Index), Converter={StaticResource fillsConverter}}"
22								   d3:ViewportPanel.ViewportWidth="1">
23							<d3:LiveToolTipService.ToolTip>
24								<d3:LiveToolTip Background="{d3:SelfBinding Path=Owner.Fill, Converter={StaticResource lighterConverter}}"
25												TextBlock.Foreground="{d3:SelfBinding Path=Owner.Fill, Converter={StaticResource backToForeConv}}">
26									<TextBlock>
27										<Run Text="X="/><TextBlock Text="{Binding Path=Owner.(d3:PointChartBase.Index), RelativeSource={RelativeSource Mode=FindAncestor, AncestorLevel=1, AncestorType={x:Type d3:LiveToolTip}}}"/>
28										<Run Text="; Y="/><TextBlock Text="{Binding}"/>										
29									</TextBlock>
30								</d3:LiveToolTip>
31							</d3:LiveToolTipService.ToolTip>
32						</Rectangle>
33					</DataTemplate>
34				</d3:TemplateMarkerGenerator>
35			</d3:ColumnChart>
36
37			<RepeatButton Name="addBtn" Content="Add value" Click="addBtn_Click" Canvas.Bottom="10" Canvas.Right="10"/>
38			<RepeatButton Name="insertBtn" Content="Insert value" Click="insertBtn_Click" Canvas.Bottom="35" Canvas.Right="10"/>
39			<RepeatButton Name="deleteBtn" Content="Delete first" Click="deleteBtn_Click" Canvas.Bottom="60" Canvas.Right="10"/>
40		</d3:ChartPlotter>
41
42		<d3:ChartPlotter Name="plotter2" Visible="0,0,1,100" Grid.Column="1">
43			<d3:HorizontalColumnChart Name="chart2" ItemsSource="{Binding}">
44				<d3:TemplateMarkerGenerator>
45					<DataTemplate>
46						<Rectangle Fill="DarkOrchid">
47							<Rectangle.ToolTip>
48								<TextBlock>
49									<Run Text="X="/>
50									<TextBlock>
51									<TextBlock.Text>
52										<Binding Path="(d3:PointChartBase.Index)" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorLevel=3, AncestorType={x:Type Rectangle}}"/>
53									</TextBlock.Text>	
54									</TextBlock><Run Text="; Y="/><TextBlock Text="{Binding}"/>
55								</TextBlock>
56							</Rectangle.ToolTip>
57						</Rectangle>
58					</DataTemplate>
59				</d3:TemplateMarkerGenerator>
60			</d3:HorizontalColumnChart>
61		</d3:ChartPlotter>
62	</Grid>
63</Page>