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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • c语言程序设计打卡系统,C语言程序设计报告书学生考勤系统设计.doc[通俗易懂]

    c语言程序设计打卡系统,C语言程序设计报告书学生考勤系统设计.doc[通俗易懂]设计题目:学生考勤系统设计设计方案:该系统能考察学生的出勤情况,所以包括每个班学生的全部信息。每个学生是一条记录,包括姓名﹑性别﹑学号,对应于某天某门课程的出勤情况等。该系统可模拟考勤过程,记录考勤结果,并能在课程结束后按照设定的考勤评分标准自动给出每个学生的考勤分数。其中,学生可在本系统在线请假以及查看学期内的上课出勤信息。在线请假中,学生可以随时查看到请假的详细进展情况。同时,学生可以查看本期…

    2022年11月3日
  • 东莞无人工厂变成现实,中国无人工厂将非常快普及,保住世界工厂地位[通俗易懂]

    东莞无人工厂变成现实,中国无人工厂将非常快普及,保住世界工厂地位

    2022年1月29日
  • idea激活码2021【2021.8最新】

    (idea激活码2021)本文适用于JetBrains家族所有ide,包括IntelliJidea,phpstorm,webstorm,pycharm,datagrip等。https://javaforall.net/100143.htmlIntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,上面是详细链接哦~B…

    2022年3月22日
  • 守护线程与线程中断区别_守护线程和主线程

    守护线程与线程中断区别_守护线程和主线程1、主线程结束,守护线程也会提前结束执行。publicclassThreadDemo1extendsThread{ publicThreadDemo1(Stringname){ super(name); } @Override publicvoidrun(){ while(true){ System.err.println(getName()…

    2022年10月10日
  • Rancher Fleet使用教程

    Rancher Fleet使用教程Rancherfleet介绍https://fleet.rancher.io/https://github.com/rancher/fleet博客截止日期为:20201204当前官网版本为v0.3.0,但在实践中发现此版本使用私有仓库无法正常工作,更新为v0.3.1可正常使用;有一些官方文档说的不清楚的地方,在这篇博客中进行了完善;fleet是一个轻量级的gitops工具,不管是管理单个集群还是大量集群都有很好的性能;两段pull工作模式:Fleetmanagerpullfr

    2022年6月14日
  • Mybatis分页插件使用的详解[通俗易懂]

    Mybatis分页插件使用的详解[通俗易懂]前言关于分页,一般来说rowBounds这种假分页都上不了台面,我们往往都选哟真分页,那么还不想搞得很麻烦,Mybatis的分页插件就为后端程序员解决了这个问题例子首先需要导入依赖,没错pagehelper<dependency><groupId>com.github.pagehelper</groupId><artifactId>pagehelper</artifactId><v

    2022年10月9日

发表回复

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

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