/// <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. 转:Java阳历转农历

    package cloud.app.prod.home.utils; import java.text.ParseException; import java.text.SimpleDateForma ...

  2. Oracle数据库版本号定期检视与升级的必要性分析

    目 录 ▇1.ORACLE数据库版本号知识 ▇2.看看自己的数据库还有没有支持服务 ▇3.看11.2.0.3版本号各PSU的公布时间与解决BUG数量列表 ▇4.看11.2.0.4版本号各PSU的公布时 ...

  3. GDI+学习之------色彩与图像

    色彩 在GDI+中.色彩是通过Color类来描写叙述的.不是用RGB类.用RGB构造会出错.GDI+中的色彩信息值是由一个32位的数据来表示的,它包含8位alpha值和各8位的R.G.B值,对于alp ...

  4. 动态规划---区间dp

    今天写内网题,连着写了两道区间dp,这里就总结一下. 区间dp思想主要是先枚举f[i][j]中的i,再枚举j,再枚举一个1~j之间的变量k,一般是f[i][j] = max(f[i][j],f[i][ ...

  5. bzoj 4709 [ Jsoi2011 ] 柠檬 —— 斜率优化DP

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4709 课上讲的题,还是参考了博客...:https://www.cnblogs.com/GX ...

  6. iOS获取相册/相机图片-------自定义获取图片小控件

    一.功能简介 1.封装了一个按钮,点击按钮,会提示从何处获取图片:如果设备支持相机,可以从相机获取,同时还可以从手机相册获取图片. 2.选择图片后,有一个block回调,根据需求,将获得的图片拿来使用 ...

  7. Spark之Structured Streaming

    目录 Part V. Streaming Stream Processing Fundamentals Structured Streaming Basics Event-Time and State ...

  8. 前端面试准备之JavaScript

    1.数据类型. JavaScript中有5种简单数据类型(也称为基本数据类型):Undefined.Null.Boolean.Number和String.还有1种复杂数据类型——Object,Obje ...

  9. CAS配置(2)之主配置

    WEB-INF目录 1.cas.properties文件(打开关闭SSL,主题,定制页面设置) #默认端口配置 #server.name=http://localhost:8080server.nam ...

  10. python 6:list.append(新元素)与list.insert(索引,新元素)(在列表末尾追加新元素、在索引处添加新元素)

    bicycles = ['trek', 'cannondale', 'redline', 'specialized'] print(bicycles) bicycles.append("ho ...