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);

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Visifire是一个流行的数据可视化工具,提供了丰富的图表样例,以方便开发人员创建各种图表。以下是一些Visifire图表样例的简介。 1. 折线图:Visifire提供了多种折线图样例,可以展示时间序列数据、趋势分析等。开发人员可以根据自己的需求选择不同的样式和设置。 2. 柱状图:Visifire的柱状图样例适用于展示不同类别的数据比较。开发人员可以自定义柱状图的颜色、宽度和注释等属性。 3. 饼图:Visifire的饼图样例可以用于展示百分比数据或者不同类别之间的比例关系。开发人员可以设置饼图的大小、颜色和标签位置等。 4. 散点图:Visifire的散点图样例适合展示二维数据的相关性。开发人员可以设置散点图的标记形状、大小和颜色,以及添加趋势线等。 5. 热力图:Visifire的热力图样例可以用于展示二维数据的密度分布,特别适用于大量数据的可视化。开发人员可以自定义热力图的颜色渐变、数值范围和标签等。 6. 金字塔图:Visifire的金字塔图样例适用于展示层级结构或者阶段比例。开发人员可以调整金字塔图的颜色、尺寸和标签位置等。 7. 股票图:Visifire的股票图样例可以展示股票价格的变化趋势。开发人员可以设置股票图的时间范围、坐标轴刻度和数据点样式等。 总之,Visifire提供了众多图表样例,可以满足不同类型和需求的数据可视化。开发人员可以根据自己的需求选择合适的样例并进行自定义设置,以实现令人印象深刻且有吸引力的数据可视化效果。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值