/// <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. bootstrap异步加载树后样式显示问题

    整个过程: 1.先加载整个页面 2.通过jquery异步请求后台返回数据 3.循环遍历数据,拼接需要的内容 4.把拼接好的数据加载到页面中. 问题: 把拼接好的内容加载到页面后,样式显示不正确.而如果 ...

  2. 关于FrameBuffer【转】

    本文转载自:http://blog.csdn.net/ganxingming/article/details/764482 一.FrameBuffer的原理 FrameBuffer 是出现在 2.2. ...

  3. Codeforces--630I--Parking Lot(规律)

     I - Parking Lot Crawling in process... Crawling failed Time Limit:500MS     Memory Limit:65536KB  ...

  4. hihocoder 1676 树上等差数列 黑科技树形dp

    #1676 : 树上的等差数列 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定一棵包含N个节点的无根树,节点编号1~N.其中每个节点都具有一个权值,第i个节点的权值 ...

  5. 【POJ 3630】 Phone List

    [题目链接] http://poj.org/problem?id=3630 [算法] 字典树 [代码] #include <algorithm> #include <bitset&g ...

  6. B1800 [Ahoi2009]fly 飞行棋 数学模拟

    20分钟一遍AC,大水题,我的算法比较复杂,但是好理解,就是找可以凑出来一半周长的点来暴力枚举就行了. 题干: Description 给出圆周上的若干个点,已知点与点之间的弧长,其值均为正整数,并依 ...

  7. EOJ 1501/UVa The Blocks Problem

    Many areas of Computer Science use simple, abstract domains for both analytical and empirical studie ...

  8. PCB 内网实现《OCR文字识别》实现逻辑

    一.实现内网信息获取网络图 二. OCR文字识别,运用技术点(啰嗦了,即然写了就都写了一遍) 三. C#客户端实现界面, 设置界面描述功能待完善,

  9. Java并发基础知识点详解

    1.synchronized与Lock区别 父类有synchtonized,子类调用父类的同步方法,是没办法同步的,因为synchronized不是修饰符,不会被继承下来. synchronized ...

  10. 10.Flask-上下文

    1.1.local线程隔离对象 不用local对象的情况 from threading import Thread request = ' class MyThread(Thread): def ru ...