/// <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实现统计图的更多相关文章

  1. 使用ArcGIS API for Silverlight + Visifire绘制地图统计图

    原文:使用ArcGIS API for Silverlight + Visifire绘制地图统计图 最近把很久之前做的统计图又拿出来重新做了一遍,感觉很多时候不复习,不记录就真的忘了,时间是最好的稀释 ...

  2. Silverlight/WPF绘制统计图Visifire.dll文件

    官网:http://www.visifire.com/ 一直没找到好的中文文档,希望有的这个的可以发个我! 效果图: 前台代码: <UserControl x:Class="Text_ ...

  3. Visifire Chart相关属性详解

    <vc:Chart x:Name="HourlyChart" Theme="Theme1" Grid.Row="1" xmlns:vc ...

  4. 【Java EE 学习 74 下】【数据采集系统第六天】【使用Jfreechart的统计图实现】【将JFreechart整合到项目中】

    之前说了JFreechart的基本使用方法,包括生成饼图.柱状统计图和折线统计图的方法.现在需要将其整合到数据采集系统中根据调查结果生成三种不同的统计图. 一.统计模型的分析和设计 实现统计图显示的流 ...

  5. 【Java EE 学习 74 上】【数据采集系统第六天】【使用Jfreechart的统计图实现】【Jfreechart的基本使用方法】

    之前已经实现了数据的采集,现在已经有了基本的数据,下一步就需要使用这些数据实现统计图的绘制了.这里使用Jfreechart实现这些统计图的绘制.首先看一下Jfreechart的基本用法,只有知道了它的 ...

  6. 使用C#和Excel进行报表开发(三)-生成统计图(Chart)

    有的Web项目选用Excel作为报表方案,在服务器端生成Excel文件,然后传送到客户端,由客户端进行打印.在国内的环境下,相对PDF方式,Excel的安装率应该比pdf阅读器的安装率要高,同时,微软 ...

  7. Html5绘制饼图统计图

    这里要介绍的是一个jQuery插件:jquery.easysector.js Html5提供了强大的绘图API,让我们能够使用javascript轻松绘制各种图形.本文将主要讲解使用HTML5绘制饼图 ...

  8. C# 绘制统计图(柱状图, 折线图, 扇形图)【转载】

    统计图形种类繁多, 有柱状图, 折线图, 扇形图等等, 而统计图形的绘制方法也有很多, 有Flash制作的统计图形, 有水晶报表生成统计图形, 有专门制图软件制作, 也有编程语言自己制作的:这里我们用 ...

  9. java利用JFreeChart实现各种数据统计图(柱形图,饼图,折线图)

    最近在做数据挖掘的课程设计,需要将数据分析的结果很直观的展现给用户,这就要用到数据统计图,要实现这个功能就需要几个第三方包了: 1.       jfreechart-1.0.13.jar 2.    ...

随机推荐

  1. 未能加载文件或程序集“System.Web.Helpers, Version=2.0.0.0

    在本地终于用上了ASP.NET MVC4自带的认证功能,但放到生产服务器上就出问题了:打开注册页面没问题,但一点下注册按钮就报错了: 未能加载文件或程序集"System.Web.Helper ...

  2. Android序列化的存储和读取

    Android中序列化的实现有两种方式:Serializable接口和Parcelable接口,本文对这两种方式进行简单的总结和使用. 一.相关概念 (一)序列化的原因(序列化能实现的效果) 1.永久 ...

  3. CodeForces - 789D Weird journey

    D. Weird journey time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...

  4. poj--3187--Backward Digit Sums(dfs)

    Backward Digit Sums Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5667   Accepted: 32 ...

  5. [SDOI2007]游戏

    https://zybuluo.com/ysner/note/1184420 题面 题意简单,但不太好概括. 戳我 解析 不成熟想法 据题意可知,字符串字符的顺序无影响. 并且判断两个字符串能否接龙可 ...

  6. 洛谷P1040 加分二叉树(区间dp)

    P1040 加分二叉树 题目描述 设一个n个节点的二叉树tree的中序遍历为(1,2,3,…,n),其中数字1,2,3,…,n为节点编号.每个节点都有一个分数(均为正整数),记第i个节点的分数为di, ...

  7. html5 读取本地文件

    尊重原创:http://hushicai.com/2014/03/29/html5-du-qu-ben-di-wen-jian.html HTML5为我们提供了一种与本地文件系统交互的标准方式:Fil ...

  8. Nginx报错-找不到路径

    前言 最近在git bash里输入命令启动Nginx服务,总提示找不到路径,令我困惑不已        我反复检查安装路径和输入命令,确认无误    小技巧:复制路径可直接ctrl+c后在git ba ...

  9. 菜鸟使用 centOS 安装 redis 并放入service 启动 记录

    1.下载redis: wget http://download.redis.io/releases/redis-2.8.17.tar.gz 若wget 不可用,请先安装wget yum install ...

  10. 【备份工具】mydumper

    Mydumper主要特性:是一个针对MySQL的高性能多线程备份和恢复工具,开发人员主要来自MySQL,Facebook,SkySQL公司. 特性: 1:轻量级C语言写的 2:执行速度比mysqldu ...