Visifire实现统计图
/// <summary>
/// 柱形图
/// </summary>
public static Chart InitCompareChart(string fundName, string tenThousandRate, string sevenRate)
{
Chart CompareChart = new Chart();
CompareChart.Theme = "Theme3";
Visifire.Charts.Title t = new Visifire.Charts.Title();
t.Text = string.Format("{0}与存款收益比较", fundName);
CompareChart.Titles.Add(t); DataSeries dataSeries = new DataSeries { RenderAs = RenderAs.Bar };
dataSeries.LabelEnabled = true;
dataSeries.LegendText = "每万元单日收益";
double tenThousandAccrual = ;
Double.TryParse(tenThousandRate, out tenThousandAccrual);
dataSeries.DataPoints.Add(new DataPoint { AxisXLabel = fundName, YValue = tenThousandAccrual });
dataSeries.DataPoints.Add(new DataPoint { AxisXLabel = "定期五年", YValue = 1.3014 });
dataSeries.DataPoints.Add(new DataPoint { AxisXLabel = "定期三年", YValue = 1.1644 });
dataSeries.DataPoints.Add(new DataPoint { AxisXLabel = "定期二年", YValue = 1.0274 });
dataSeries.DataPoints.Add(new DataPoint { AxisXLabel = "定期一年", YValue = 0.8219 });
dataSeries.DataPoints.Add(new DataPoint { AxisXLabel = "定期半年", YValue = 0.7671 });
dataSeries.DataPoints.Add(new DataPoint { AxisXLabel = "定期三月", YValue = 0.7123 });
dataSeries.DataPoints.Add(new DataPoint { AxisXLabel = "活期", YValue = 0.0959 }); DataSeries dataSeries2 = new DataSeries { RenderAs = RenderAs.Bar };
dataSeries2.LabelEnabled = true;
dataSeries2.LegendText = "七日年化收益率";
double qiRiAnnualizedYield = ;
Double.TryParse(sevenRate.Replace("%", ""), out qiRiAnnualizedYield);
dataSeries2.DataPoints.Add(new DataPoint { AxisXLabel = fundName, YValue = qiRiAnnualizedYield });
dataSeries2.DataPoints.Add(new DataPoint { AxisXLabel = "定期五年", YValue = 4.75 });
dataSeries2.DataPoints.Add(new DataPoint { AxisXLabel = "定期三年", YValue = 4.25 });
dataSeries2.DataPoints.Add(new DataPoint { AxisXLabel = "定期二年", YValue = 3.75 });
dataSeries2.DataPoints.Add(new DataPoint { AxisXLabel = "定期一年", YValue = 3.00 });
dataSeries2.DataPoints.Add(new DataPoint { AxisXLabel = "定期半年", YValue = 2.80 });
dataSeries2.DataPoints.Add(new DataPoint { AxisXLabel = "定期三月", YValue = 2.60 });
dataSeries2.DataPoints.Add(new DataPoint { AxisXLabel = "活期", YValue = 0.35 }); CompareChart.Series.Add(dataSeries);
CompareChart.Series.Add(dataSeries2); return CompareChart;
} /// <summary>
///折线统计图
/// </summary>
public static Chart InitTenThousandRateChart(string fundName, List<FundDay> fundDayList)
{
Chart TrendChart = new Chart();
TrendChart.Theme = "Theme3";
Visifire.Charts.Title t = new Visifire.Charts.Title();
t.Text = string.Format("{0}单日万元收益走势", fundName);
TrendChart.Titles.Add(t); DataSeries AccrualSeries = new DataSeries { RenderAs = RenderAs.Line };
AccrualSeries.LabelEnabled = true;
AccrualSeries.LegendText = "每万元单日收益"; int listCount = fundDayList.Count;
int dayIndex = (listCount >= ) ? : listCount;//限定最多只能取七天的数据做走势图,并且保证时间轴(X轴)的最右端是最新日期 if (listCount > )
{
while (dayIndex >= )
{
FundDay fundDay = fundDayList[dayIndex]; string date = fundDay.Date.Substring(fundDay.Date.IndexOf("-") + ); double tenThousandAccrual = ;
Double.TryParse(fundDay.TenThousandRate, out tenThousandAccrual);
AccrualSeries.DataPoints.Add(new DataPoint { AxisXLabel = date, YValue = tenThousandAccrual }); dayIndex--;
}
} Axis a = new Axis();
a.StartFromZero = false;
TrendChart.AxesY.Add(a); TrendChart.Series.Add(AccrualSeries); return TrendChart;
}
Visifire实现统计图的更多相关文章
- 使用ArcGIS API for Silverlight + Visifire绘制地图统计图
原文:使用ArcGIS API for Silverlight + Visifire绘制地图统计图 最近把很久之前做的统计图又拿出来重新做了一遍,感觉很多时候不复习,不记录就真的忘了,时间是最好的稀释 ...
- Silverlight/WPF绘制统计图Visifire.dll文件
官网:http://www.visifire.com/ 一直没找到好的中文文档,希望有的这个的可以发个我! 效果图: 前台代码: <UserControl x:Class="Text_ ...
- Visifire Chart相关属性详解
<vc:Chart x:Name="HourlyChart" Theme="Theme1" Grid.Row="1" xmlns:vc ...
- 【Java EE 学习 74 下】【数据采集系统第六天】【使用Jfreechart的统计图实现】【将JFreechart整合到项目中】
之前说了JFreechart的基本使用方法,包括生成饼图.柱状统计图和折线统计图的方法.现在需要将其整合到数据采集系统中根据调查结果生成三种不同的统计图. 一.统计模型的分析和设计 实现统计图显示的流 ...
- 【Java EE 学习 74 上】【数据采集系统第六天】【使用Jfreechart的统计图实现】【Jfreechart的基本使用方法】
之前已经实现了数据的采集,现在已经有了基本的数据,下一步就需要使用这些数据实现统计图的绘制了.这里使用Jfreechart实现这些统计图的绘制.首先看一下Jfreechart的基本用法,只有知道了它的 ...
- 使用C#和Excel进行报表开发(三)-生成统计图(Chart)
有的Web项目选用Excel作为报表方案,在服务器端生成Excel文件,然后传送到客户端,由客户端进行打印.在国内的环境下,相对PDF方式,Excel的安装率应该比pdf阅读器的安装率要高,同时,微软 ...
- Html5绘制饼图统计图
这里要介绍的是一个jQuery插件:jquery.easysector.js Html5提供了强大的绘图API,让我们能够使用javascript轻松绘制各种图形.本文将主要讲解使用HTML5绘制饼图 ...
- C# 绘制统计图(柱状图, 折线图, 扇形图)【转载】
统计图形种类繁多, 有柱状图, 折线图, 扇形图等等, 而统计图形的绘制方法也有很多, 有Flash制作的统计图形, 有水晶报表生成统计图形, 有专门制图软件制作, 也有编程语言自己制作的:这里我们用 ...
- java利用JFreeChart实现各种数据统计图(柱形图,饼图,折线图)
最近在做数据挖掘的课程设计,需要将数据分析的结果很直观的展现给用户,这就要用到数据统计图,要实现这个功能就需要几个第三方包了: 1. jfreechart-1.0.13.jar 2. ...
随机推荐
- Extjs 3 控制Grid某行某列不可编辑
var cmGoodsFee = new Ext.grid.ColumnModel([rmGoodsFee, { header : "id", tooltip : "id ...
- B1208 [HNOI2004]宠物收养所 平衡树||set (滑稽)
这个题是一道splay裸题,但是我不太会写,所以用set直接水过去!!!哈哈哈哈,美滋滋. set总结: set是一个集合,然后里面没用重复的元素.里面有一些函数: begin() ,返回se ...
- HTTP服务端JSON服务端
HTTP服务端JSON服务端 最后更新日期: 2014-5-18 Author: Kagula 阅读前提: CMake工具的基本使用 内容简介: CPPCMS是个开源Web开发框架,通过它可以很容易 ...
- This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery
This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'的意思是,这版本的 MySQL 不支持使 ...
- json用法
什么是JSON? JavaScript 对象表示法(JavaScript Object Notation). JSON是一种轻量级的数据交换格式,某个JSON格式的文件内部譬如可以长成这样: 1 2 ...
- [Apple开发者帐户帮助]二、管理你的团队(2)更改团队成员角色
如果您已加入Apple开发者计划,您将在App Store Connect中管理团队成员.有关详细信息,请转到App Store Connect帮助中的添加和编辑用户. 如果您已加入Apple Dev ...
- X - Vasya and Socks
Problem description Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pai ...
- Spring Cloud (3) 服务消费者-Ribbon
在上一篇中使用LoadBalancerClient接口实现了获取某个服务的具体实例,并根据实例信息发起服务接口消费请求.但是这样的做法需要我们手工的区编写服务选取.连接拼接等繁琐的工作,对于开发人员来 ...
- 前端编码规范(2)HTML 规范
文档类型 推荐使用 HTML5 的文档类型申明: <!DOCTYPE html> (建议使用 text/html 格式的 HTML.避免使用 XHTML.XHTML 以及它的属性,比如 a ...
- Beta冲刺-星期五
这个作业属于哪个课程 <课程的链接> 这个作业要求在哪里 <作业要求的链接> 团队名称 Three cobblers 这个作业的目标 完成项目最后的冲刺 ...