VisiFire示例

VisiFire示例Syntax:LabelText=”#AxisXLabel,#YValue” /> BelowisthechartaftersettingLabelTextproperty:   Modifiers: Modifier

大家好,又见面了,我是你们的朋友全栈君。

VisiFire示例

Syntax:

<vc:Chart … >

<vc:Chart.Series>

<vc:DataSeries>

<vc:DataSeries.DataPoints>

<vc:DataPoint LabelText=”#AxisXLabel, #YValue” />

</vc:DataSeries.DataPoints>

</vc:DataSeries>

</vc:Chart.Series>

</vc:Chart>

 

Below is the chart after setting LabelText property:

 

labeltext.jpg

 

 

Modifiers:

 

Modifier

Description

#AxisXLabel

Returns the axis label value if axis labels is present for that XValue. Otherwise returns XValue.

#Percentage

Returns the percentage value with respect to DataPoints in that series.

#Series

Returns the series name.

#Sum

Returns sum of values in entire chart with same XValue. (Used for stacked charts only)

#XValue

Returns XValue.

#YValue

Returns YValue.

#ZValue

Returns ZValue.

#Open

Returns Open value.

#Close

Returns Close value.

#High

Returns High value.

#Low

Returns Low value.

 

Remarks:

  1. The above modifiers are applicable for LabelText set in DataPoint or DataSeries only.

  2. Modifiers can be used in any combination to display DataPoint specific content.

  3. To display the modifier itself use the ‘#’ twice. For example to display “#XValue” as label use LabelText=”##XValue”

  4. The default value for LabelText in Pie/Doughnut and Funnel charts is “AxisXLabel, #YValue”.

  5. The default value for LabelText in CandleStick and Stock charts is “#Close”.

  6. The default value for LabelText in all other charts is “#YValue”.

  7. For CandleStick and Stock charts, LabelText can be set as LabelText=”#Open, #Close, #High, #Low, #YValue”. For CandleStick and Stock charts, volume information can be stored in YValue property and can be showed as a LabelText for DataPoints. Note that YValue property is not being used in CandleStick and Stock charts.

  8. For Stacked charts, percentage will be calculated from the DataPoints present in each XValue. In other words, percentage will be calculated for stacked DataPoints (in each XValue) from all series.

  9. For CandleStick and Stock charts, percentage will be calculated for Closing price in DataPoints.

示例:

      Chart chart = new Chart();
            chart.ScrollingEnabled = true;
            chart.View3D = false;

            Title title = new Title();
            title.Text = Title+”血型统计(按月分组)”;
            chart.Titles.Add(title);

            Axis axis = new Axis();
            axis.IntervalType = IntervalTypes.Number;
            axis.Suffix = “月”; 
            axis.Interval = 1;
            axis.Title = “血型”;
            chart.AxesX.Add(axis);

            Axis yaxis = new Axis();
            yaxis.Enabled = true;
            // 坐标轴类型,可以是primary或secondary,这个属性只能用于Y轴,只有在设置了DataSeries的AxisYType属性后才会启用
            yaxis.AxisType = AxisTypes.Primary;
            chart.AxesY.Add(yaxis);

            //血型总共5个种类:A,B,AB,O,未知
            string[] bloodType = new string[5] { “A”, “B”, “AB”, “O”, “未知” };
            int[] months = new int[12] {1,2,3,4,5,6,7,8,9,10,11,12};
            for (Int32 j = 0; j < bloodType.Length; j++)
            {

                DataSeries dataSeries = new DataSeries();

                string blood=bloodType[j];
                dataSeries.Name = blood;
                dataSeries.RenderAs = RenderAs.Column;
                dataSeries.ShowInLegend = true;
                dataSeries.XValueType = ChartValueTypes.Numeric;
                dataSeries.ToolTipText = “#Series型血,袋数:#YValue,#AxisXLabel”;

                DataPoint dataPoint;
                for (int i = 0; i < months.Length; i++)
                {

                    dataPoint = new DataPoint();
                    int month = months[i];
                    dataPoint.XValue = month;

                    int count = 0;
                    if (j == 4)
                    {

                        count = list.Where(a => string.IsNullOrWhiteSpace(a.BloodType) && a.FiltrDate.Month.Equals(month)).Count();
                    }
                    else
                    {

                        count = list.Where(a => a.BloodType == blood && a.FiltrDate.Month.Equals(month)).Count();
                    }

                    if (count > 0)
                    {

                        dataPoint.LabelEnabled = true;
                        dataPoint.LabelStyle = LabelStyles.OutSide;
                    }
                    else
                    {

                        dataPoint.LabelEnabled = false;
                    }
                    dataPoint.YValue=count;

                    dataSeries.DataPoints.Add(dataPoint);
                }

                chart.Series.Add(dataSeries);
            }
            BloodChart.Children.Add(chart);

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/162776.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 虚拟化为您打造下一代数据中心

    虚拟化为您打造下一代数据中心

    2021年7月27日
    53
  • pycharm2022 免费激活码【中文破解版】2022.02.13

    (pycharm2022 免费激活码)最近有小伙伴私信我,问我这边有没有免费的intellijIdea的激活码,然后我将全栈君台教程分享给他了。激活成功之后他一直表示感谢,哈哈~https://javaforall.net/100143.htmlIntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,上面是详细链接哦~4KDD…

    2022年4月1日
    58
  • 空间矢量脉冲宽度调制(SVPWM)Simulink仿真教程

    空间矢量脉冲宽度调制(SVPWM)Simulink仿真教程目录SVPWM仿真主体结构扇区选择模块XYZ计算模块矢量作用模块切换时间判断模块三角波模块开关信号模块输出信号模块输出结果SVPWM参考文献​SVPWM仿真主体结构扇区选择模块原理基于原理搭建基于原理的s函数扇区输出结果XYZ计算模块原理基于原理搭建模块仿真结果矢量作用模块原理基于原理搭建模块仿真结果切换时间判断模块原理…

    2022年10月31日
    0
  • 什么是Java多态?如何实现Java多态?[通俗易懂]

    什么是Java多态?如何实现Java多态?[通俗易懂]java多态这个概念在同学们深入学习java的时候就会被提出,很多同学并不知道是什么意思,如何实现。今天小千就来给大家介绍一下什么是java多态和java如何实现多态。什么是多态?指允许不同类的对象对同一消息做出响应。即同一消息可以根据发送对象的不同而采用多种不同的行为方式。(发送消息就是函数调用)实现多态的技术称为:动态绑定(dynamicbinding),是指在执行期间判断所引用对象的实际类型,根据其实际的类型调用其相应的方法。多态的作用:消除类型之间的耦合关系。现实中,关于多态的例子不胜

    2022年7月8日
    39
  • the beginning of_The king

    the beginning of_The kingThe 2016 Asia Regional Contest, Tsukuba Quality of Check Digits Gym – 101158B

    2022年4月20日
    32
  • 决策树原理解析_解析的原理

    决策树原理解析_解析的原理决策树原理解析1.决策树算法以及基本流程决策树是基于树结构进行决策的,其机制就是通过判定每个属性分类的纯度来进行自上而下决策分类决策树包含根结点,内部结点,叶结点;根结点和内部结点对应与分类的属性(也就是分类的基准),叶结点对应决策结果(也就是纯度很高且不需要继续分裂的类别);从根结点到某一个叶结点的路径便是当前叶结点对应类的整个决策过程,下面来看决策树的算法流程:可以看到决…

    2022年9月8日
    0

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号