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


相关推荐

  • clion 2021 激活码破解方法

    clion 2021 激活码破解方法,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月15日
    1.3K
  • 系统集成工程师被取消_软考信息系统管理工程师

    系统集成工程师被取消_软考信息系统管理工程师软考中级——系统集成项目管理工程师备考干货第二章:信息系统集成及服务管理。

    2022年10月4日
    2
  • java获取modelmap_Model与ModelMap

    java获取modelmap_Model与ModelMapModel与ModelMapSpringMVC应用中,我们经常需要在Controller将数据传递到JSP页面,除了可以通过HttpServletRequest域传递外,SpringMVC还提供了两个Api,分别为Model接口和ModelMap类。接下来看看如何使用?1编写控制器数据存入域packagecom.yiidian.controller;importorg.springfra…

    2022年6月28日
    30
  • java dump分析工具_java线程dump分析工具

    java dump分析工具_java线程dump分析工具一、【内存dump】jmap–dump:live,format=b,file=heap.bin二、【线程dump】jstack是java虚拟机自带的一种堆栈跟踪工具。基本介绍:jstack用于生成java虚拟机当前时刻的线程快照。线程快照是当前java虚拟机内每一条线程正在执行的方法堆栈的集合,生成线程快照的主要目的是定位线程出现长时间停顿的原因,如线程间死锁、死循环、请求外部资源导致的长时间…

    2022年10月2日
    2
  • 网页升级中每天自动更新什么意思_快照搜索

    网页升级中每天自动更新什么意思_快照搜索网站被收录是百度蜘蛛爬行、记录、筛选的结果。网站被爬行后会在搜索引擎数据库中留下数据,当判断收录的内容达到用户要求质量时,网站的快照才会被释放出来,而快照的时候很多时候都是最初的爬行时间。这也是我们很多站长发现被收录后,快照时间不是当天时间的原因了。  在我们的认知中,每次百度快照的更新都是搜素引擎对网站数据的一次爬行收录过程,也就意味着更新就会带来网站排名的微调动。所以,更多时候

    2022年9月1日
    4
  • Java 的JSON、XML转换方法——目录索引(转)[通俗易懂]

    Java 的JSON、XML转换方法——目录索引(转)[通俗易懂]Java 的JSON、XML转换方法——目录索引(转)

    2022年4月22日
    62

发表回复

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

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