zoukankan      html  css  js  c++  java
  • SliverLight(how to show data point on the column series)

    You should know that Silverlight comes with win form drawing software is different, it has no the label property. So, if you want to let data points shown on the columns. You must use Style property.

     As follows:

    1. Set up style on Application

     ColumnSeries series = new ColumnSeries();//Create series

                series.ItemsSource = KPIData;//Bind data

                series.IndependentValueBinding = new System.Windows.Data.Binding("UserName");//Bind Rows

                series.DependentValueBinding = new System.Windows.Data.Binding("Score");//Bind cells

                series.AnimationSequence = AnimationSequence.FirstToLast;//Sequence

                Style style = (Style)Application.Current.Resources["MyColumnDataStyle"];//Get DataPoint labels

     2.   Configure Application

    Add in App.xaml

     <Application.Resources>

            <Style TargetType="charting:ColumnDataPoint" x:Key="MyColumnDataStyle">

                <Setter Property="Template">

                    <Setter.Value>

                        <ControlTemplate TargetType="charting:ColumnDataPoint">

                            <Grid>

                                <Rectangle Fill="{TemplateBinding Background}" Stroke="Black"/>

                                <Grid Margin="0 -20 0 0" HorizontalAlignment="Center" VerticalAlignment="Top">

                                    <TextBlock Text="{TemplateBinding FormattedDependentValue}" Margin="2"/>

                                </Grid>

                            </Grid>

                        </ControlTemplate>

                    </Setter.Value>

                </Setter>

            </Style>

        </Application.Resources>

    </Application>

     3. Show data points labels

  • 相关阅读:
    hdu 5534(dp)
    hdu 5533(几何水)
    hdu 5532(最长上升子序列)
    *hdu 5536(字典树的运用)
    hdu 5538(水)
    假如数组接收到一个null,那么应该怎么循环输出。百度结果,都需要提前判断。否则出现空指针异常。。我还是想在数组中实现保存和输出null。
    第一个登录页面 碰到的疑问
    浅谈堆和栈的区别
    Java中的基础----堆与栈的介绍、区别
    JS的Document属性和方法
  • 原文地址:https://www.cnblogs.com/jacksundatashare/p/4981557.html
Copyright © 2011-2022 走看看