博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Siverlight MarkerSize 控制数据点半径大小 LineThickness 控制点与点之间直线的厚度
阅读量:5794 次
发布时间:2019-06-18

本文共 7037 字,大约阅读时间需要 23 分钟。

using System;

using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebApp.Common;
using Contract.Domain;
using System.Collections;
using System.Data;

namespace HraWeb

{
public partial class Report3 : JQEntityManage<MktPriceMarketData>
{
protected override void Page_Load(object sender, EventArgs e)
{
//给基类服务接口复制,可不付
//base.svc = Psvc;
if (!IsPostBack)
{
if (Request["_method"] == "GetReport")
{
string riskBookId = Request["txt_select_"].ToString();
string startTime = Request["txt_startTime_"].ToString();
string endTime = Request["txt_endTime_"].ToString();
string simulationNumber = Request["txt_simulationNumber_"].ToString();
string confidenceLevel = Request["txt_select_confidence_"].ToString();
string viewType = Request["viewtype"].ToString();
//riskBookId = "10002";
//confidenceLevel = "1404";
//txt_startTime_.Value = startTime;
//txt_endTime_.Value = endTime;
if (string.IsNullOrEmpty(riskBookId) || string.IsNullOrEmpty(startTime) || string.IsNullOrEmpty(endTime) || string.IsNullOrEmpty(simulationNumber) || string.IsNullOrEmpty(confidenceLevel))
{
string s = "查询参数均不可为空";
Response.Write("查询参数均不可为空");
Response.End();
//throw new Exception("查询参数均不可为空!");

}

//if (!string.IsNullOrEmpty(startTimeParam))

//{
// stratTime = startTimeParam;
//}
//Newtonsoft.Json.JsonConvert.SerializeObject(GetReportJson(stratTime, endTime));
Framework.QueryInfo info = new Framework.QueryInfo();
info.QueryObject = "RskBookBacktest";

//info.AddParam("ComputeDate", computeDate);

//info.AddParam("SimulationNumber", simulationNumber);
//info.AddParam("RiskBookId", riskBookId);
info.CustomSQL = string.Format("select to_char(Compute_Date,'yyyy-mm-dd') as Compute_Date,Change_Inmtm_Value,Upper_Bound_Value,Lower_Bound_Value from Rsk_Book_Backtest where to_char(Compute_Date,'yyyy-mm-dd')>='" + startTime + "' and to_char(Compute_Date,'yyyy-mm-dd')<='" + endTime + "' and Risk_Book_Id=" + riskBookId + " and Simulation_Number=" + simulationNumber + " and Confidence_Level='{0}'",confidenceLevel) ;

//info.CustomSQL = string.Format("select ResetDate,MiddlePriceValue,IndexPriceFactorId,IndexPriceFactorName from {0} where to_char(ResetDate,'yyyy-mm-dd')>='{1}' and to_char(ResetDate,'yyyy-mm-dd')<='{2}' and IndexPriceFactorId={3} order by ResetDate ASC", "MktPriceMarketData", startTime, endTime, factorId);

//IList list = Dao.FindByQueryInfo(info).List;

DataSet dt = Dao.ExcuteDataSet(info);
//Response.End();
string outputtext = "<script language='javascript' type='text/javascript'>";
//outputtext += "var vChart = new Visifire2('SL.Visifire.Charts.xap', 800, 500);";
var dataXml = "";
if (viewType == "3d")
dataXml += "<vc:Chart xmlns:vc='clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts' Width='800' Height='500' Theme='Theme1' BorderThickness='0' View3D='True' Watermark='False' ScrollingEnabled='False'>";
else if (viewType == "2d")
dataXml += "<vc:Chart xmlns:vc='clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts' Width='800' Height='500' Theme='Theme1' BorderThickness='0' View3D='False' Watermark='False' ScrollingEnabled='False'>";
dataXml += "<vc:Chart.Titles><vc:Title Text='分析图2'/></vc:Chart.Titles>";
dataXml += "<vc:Chart.AxesX><vc:Axis Title='计算日期'></vc:Axis></vc:Chart.AxesX>";
dataXml += "<vc:Chart.AxesY><vc:Axis Title='频数值' /></vc:Chart.AxesY>";
dataXml += "<vc:Chart.Series>";
string column = string.Empty;
string line1 = string.Empty;
string line2 = string.Empty;
foreach (DataRow row in dt.Tables[0].Rows)
{
column += "<vc:DataPoint BorderThickness='0' AxisXLabel='" + row["Compute_Date"].ToString() + "' YValue='" + row["Change_Inmtm_Value"].ToString() + "'/>";
line1 += "<vc:DataPoint BorderThickness='80' AxisXLabel='" + row["Compute_Date"].ToString() + "' YValue='" + row["Upper_Bound_Value"].ToString() + "'/>";
line2 += "<vc:DataPoint BorderThickness='0' AxisXLabel='" + row["Compute_Date"].ToString() + "' YValue='" + row["Lower_Bound_Value"].ToString() + "'/>";
}
//MarkerSize 控制数据点半径大小 LineThickness 控制点与点之间直线的厚度
dataXml += "<vc:DataSeries LegendText='' RenderAs='Column' MarkerSize='0' LabelEnabled='False' LabelStyle='OutSide' Cursor='Hand' LineThickness='3'>";
dataXml += "<vc:DataSeries.DataPoints>";
dataXml += column;
dataXml += "</vc:DataSeries.DataPoints>";
dataXml += "</vc:DataSeries>";

dataXml += "<vc:DataSeries LegendText='' RenderAs='Line' LightingEnabled='False' FontSize='2' MarkerSize='8' LabelEnabled='False' LabelStyle='OutSide' Cursor='Hand' LineThickness='3'>";

dataXml += "<vc:DataSeries.DataPoints>";
dataXml += line1;
dataXml += "</vc:DataSeries.DataPoints>";
dataXml += "</vc:DataSeries>";

dataXml += "<vc:DataSeries LegendText='' RenderAs='Line' LightingEnabled='False' MarkerSize='8' LabelEnabled='False' LabelStyle='OutSide' Cursor='Hand' LineThickness='3'>";

dataXml += "<vc:DataSeries.DataPoints>";
dataXml += line2;
dataXml += "</vc:DataSeries.DataPoints>";
dataXml += "</vc:DataSeries>";
dataXml += "</vc:Chart.Series>";
dataXml += "</vc:Chart>";
Response.Write(dataXml);
Response.End();
//dataXml += "";

//outputtext += "var dataXml = \"" + dataXml + "\";";

//outputtext += "</script>";
//json.InnerHtml = outputtext;
}
}
base.Page_Load(sender, e);
}

public IList GetReportJson(string stratTime, string endTime)

{
Framework.QueryInfo info = new Framework.QueryInfo();
info.CustomSQL = string.Format("select ResetDate,MiddlePriceValue from {0} where to_char(ResetDate,'yyyy-mm-dd')>='{1}' and to_char(ResetDate,'yyyy-mm-dd')<='{2}'", typeof(MktPriceMarketData).Name, stratTime, endTime);
IList list = Dao.FindByQueryInfo(info).List;
return list;
}

/// <summary>

/// 设置查询条件或者语句
/// </summary>
/// <returns></returns>
protected override Framework.QueryInfo SetInfo()
{
info = base.SetInfo();
return info;
}
/// <summary>
/// 初始化页面控件
/// </summary>
protected override void InitPage()
{
BindDrop(this.txt_select_confidence_, "CONFIDENCE_LEVEL", true);
base.InitPage();
Framework.QueryInfo info = new Framework.QueryInfo();
info.CustomSQL = "select distinct simulation_number from Rsk_Book_Backtest";
DataSet dt = Dao.ExcuteDataSet(info);
txt_simulationNumber_.DataSource = dt.Tables[0];
txt_simulationNumber_.DataTextField = "simulation_number";
txt_simulationNumber_.DataValueField = "simulation_number";
txt_simulationNumber_.DataBind();

info = new Framework.QueryInfo();

info.CustomSQL = "select Risk_Book_Id,Risk_Book_Name from Rsk_Book";
dt = Dao.ExcuteDataSet(info);
this.txt_select_.DataSource = dt.Tables[0];
this.txt_select_.DataTextField = "Risk_Book_Name";
this.txt_select_.DataValueField = "Risk_Book_Id";
this.txt_select_.DataBind();
//BindDrop("RiskBookId", "RiskBookName", "RiskBook", txt_select_, "");
}
//private Contract.IService.IMktPriceMarketDataService psvc;
/ <summary>
/ 初始化
/ </summary>
//Contract.IService.IMktPriceMarketDataService Psvc
//{
// get
// {
// if (psvc == null)
// {
// psvc = ctx.GetObject("MktPriceMarketDataService") as Contract.IService.IMktPriceMarketDataService;
// }
// return psvc;

// }

//}
}
}

转载于:https://www.cnblogs.com/kexb/p/4615519.html

你可能感兴趣的文章
[ACM] POJ 3233 Matrix Power Series (求矩阵A+A^2+A^3...+A^k,二分求和或者矩阵转化)
查看>>
MapReduce编程(七) 倒排索引构建
查看>>
HDUOJ A Mathematical Curiosity 1017
查看>>
Unity3D 使用XML进行简单的配置文件改动
查看>>
Java基础(十):封装
查看>>
大会聚焦 | 开源技术盛会LinuxCon首次来到中国,大咖齐聚关注业界动态
查看>>
CSS鼠标悬浮DIV后显示DIV外的按钮
查看>>
以后要进行数据收集,打开邮箱就行了 | formtalk入驻Office 应用商店
查看>>
【树莓派】树莓派盒子性能监控管理
查看>>
Android 给WebView设置Cookie
查看>>
JavaSE(八)之集合概述
查看>>
第三百七十六节,Django+Xadmin打造上线标准的在线教育平台—创建用户操作app,在models.py文件生成5张表,用户咨询表、课程评论表、用户收藏表、用户消息表、用户学习表...
查看>>
纹理文本
查看>>
Nginx 学习笔记(一)如何配置一个安全的HTTPS网站服务器
查看>>
反射原理(Class获取方式)
查看>>
[LeetCode] Maximum Swap 最大置换
查看>>
CentOS7 vsftp使用ftp客户端登录时不同的用户进入到不同的文件夹方法
查看>>
css animation和keyframes
查看>>
根据MAC地址前6位知道网络设备是哪家公司生产的
查看>>
JavaWeb(四)EL表达式
查看>>