首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Silverlight中显示数据点标签?

如何在Silverlight中显示数据点标签?
EN

Stack Overflow用户
提问于 2013-03-19 00:05:11
回答 1查看 1.4K关注 0票数 0

我在Silverlight中看不到任何显示数据点标签的属性(应该总是可见的),谷歌也没有给出任何joy……

你知道怎么做吗?

这是我的XAML

代码语言:javascript
复制
  <toolkit:Chart Height="400" Width="600" Title="Cumulative Age Dispersions" >


                <toolkit:Chart.Axes>
                    <toolkit:CategoryAxis Title="Content Items"  Orientation="X" />
                    <toolkit:CategoryAxis Title="Seconds" Orientation="Y" Location="Right" />
                </toolkit:Chart.Axes>

                <toolkit:ColumnSeries  Title="Male" ItemsSource="{Binding MaleSerie}" IndependentValueBinding="{Binding ItemName}"
                    DependentValueBinding="{Binding Count}"   ToolTipService.ToolTip="{Binding Count}"
                    AnimationSequence="Simultaneous" 
                    HorizontalAlignment="Left" Height="304" VerticalAlignment="Top" Width="266"/>

                <toolkit:ColumnSeries  Title="Female" ItemsSource="{Binding FemaleSerie}" IndependentValueBinding="{Binding ItemName}"
                    DependentValueBinding="{Binding Count}"  ToolTipService.ToolTip="{Binding Count}"
                    AnimationSequence="Simultaneous" 
                    HorizontalAlignment="Left" Height="304" VerticalAlignment="Top" Width="266">


                </toolkit:ColumnSeries>

            </toolkit:Chart>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-03-19 00:14:13

好了..。

代码语言:javascript
复制
        <toolkit:Chart.Axes>
            <toolkit:CategoryAxis Title="Content Items"  Orientation="X" />
            <toolkit:CategoryAxis Title="Seconds" Orientation="Y" Location="Right" />
        </toolkit:Chart.Axes>

        <toolkit:ColumnSeries  Title="Male" ItemsSource="{Binding MaleSerie}" IndependentValueBinding="{Binding ItemName}"
            DependentValueBinding="{Binding Count}"   ToolTipService.ToolTip="{Binding Count}"
            AnimationSequence="Simultaneous" 
            HorizontalAlignment="Left" Height="304" VerticalAlignment="Top" Width="266"/>

        <toolkit:ColumnSeries  Title="Female" ItemsSource="{Binding FemaleSerie}" IndependentValueBinding="{Binding ItemName}"
            DependentValueBinding="{Binding Count}"  ToolTipService.ToolTip="{Binding Count}"
            AnimationSequence="Simultaneous" 
            HorizontalAlignment="Left" Height="304" VerticalAlignment="Top" Width="266">

            <toolkit:ColumnSeries.DataPointStyle>
                <Style TargetType="toolkit:ColumnDataPoint">
                    <Setter Property="Background" Value="Green"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="toolkit:ColumnDataPoint">
                                <Grid>
                                    <Rectangle
                            Fill="{TemplateBinding Background}"
                            Stroke="Black"/>
                                    <Grid
                            Background="#aaffffff"
                            Margin="0 -40 -10 0"
                            HorizontalAlignment="Right"
                            VerticalAlignment="Center">
                                        <TextBlock
                                Text="{TemplateBinding FormattedDependentValue}"
                                FontWeight="Bold" Width="40"
                                Margin="2"/>
                                    </Grid>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </toolkit:ColumnSeries.DataPointStyle>

        </toolkit:ColumnSeries>

    </toolkit:Chart>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15481387

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档