silverlight 双坐标轴
public void CreateLine(Grid oGrid, string sTitle, string sTableName, bool ifGetSig, string sYUint, string sYUint2, string sYTitle1, string sYTitle2, string sYTitle3, string[] sXLabel, double[] dYValue1, double[] dYValue2, double[] dYValue3)
{
Chart chart = new MyChart();
chart.Width = 500;//宽
chart.Height = 300;//高
//chart.Margin = new Thickness(0, 20, 40, 0);
chart.Margin = new Thickness(0, 0, 10, 20); //位置
chart.ScrollingEnabled = false;
chart.Name = sTableName;
chart.DataPointWidth = 2.5;
if (ifGetSig)
{
chart.MouseLeftButtonUp += new MouseButtonEventHandler(chart_MouseLeftButtonUp);
}
Title title = new Title();
title.Text = sTitle; //图表标题
title.FontSize = 15;//图表标题字体大小
chart.Titles.Add(title);
// X 坐标轴
Axis axisX = new Axis();
AxisLabels xal = new AxisLabels //X 坐标轴样式
{
//Enabled = true, //设置是否显示坐标轴上的文本,默认值为true
//Angle = 45,//设置文本显示的角度,取值为 –90 至 90
FontSize = 13//设置文字大小
};
axisX.AxisLabels = xal;
chart.AxesX.Add(axisX);
// Y 坐标轴
Axis axisY = new Axis();
AxisLabels yal = new AxisLabels // Y 坐标轴样式
{
//Enabled = true, //设置是否显示坐标轴上的文本,默认值为true
//Angle = 45,//设置文本显示的角度,取值为 –90 至 90
FontSize = 13//设置文字大小
};
axisY.AxisLabels = yal;
axisY.Title = sYUint; //Y坐标轴单位
axisY.TitleFontSize = 14;//Y坐标轴单位字体大小
chart.AxesY.Add(axisY);
title.MouseLeftButtonDown += new MouseButtonEventHandler(title_MouseLeftButtonDown);
// Y 坐标轴 双坐标轴
Axis axisYT = new Axis() { AxisType = AxisTypes.Secondary };// 双坐标轴
AxisLabels yalT = new AxisLabels
{
//Enabled = true, //设置是否显示坐标轴上的文本,默认值为true
//Angle = 45,//设置文本显示的角度,取值为 –90 至 90
FontSize = 13//设置文字大小
};
axisYT.AxisLabels = yalT;
axisYT.Title = sYUint2; //双坐标轴单位
axisYT.TitleFontSize = 14;//双坐标轴单位字体大小
chart.AxesY.Add(axisYT);
////设置图标字体大小
//Legend legend = new Legend();
//legend.FontSize = 13;
//chart.Legends.Add(legend);
DataSeries dataSeries1 = new DataSeries();
dataSeries1.LegendText = sYTitle1;
dataSeries1.RenderAs = RenderAs.Line;
dataSeries1.AxisYType = AxisTypes.Primary;
DataSeries dataSeries2 = new DataSeries();
dataSeries2.LegendText = sYTitle2;
dataSeries2.RenderAs = RenderAs.Line;
dataSeries2.AxisYType = AxisTypes.Primary;
DataSeries dataSeries3 = new DataSeries();
dataSeries3.LegendText = sYTitle3;
dataSeries3.RenderAs = RenderAs.Line;
dataSeries3.AxisYType = AxisTypes.Secondary;
DataPoint dp1;
DataPoint dp2;
DataPoint dp3;
for (int i = 0; i < sXLabel.Length; i++)
{
dp1 = new DataPoint();
dp2 = new DataPoint();
dp3 = new DataPoint();
dp1.AxisXLabel = sXLabel[i];
dp1.YValue = dYValue1[i];
dataSeries1.DataPoints.Add(dp1);
dp2.AxisXLabel = sXLabel[i];
dp2.YValue = dYValue2[i];
dataSeries2.DataPoints.Add(dp2);
dp3.AxisXLabel = sXLabel[i];
dp3.YValue = dYValue3[i];
dataSeries3.DataPoints.Add(dp3);
}
chart.Series.Add(dataSeries1);
chart.Series.Add(dataSeries2);
chart.Series.Add(dataSeries3);
oGrid.Children.Add(chart);
}
silverlight 双坐标轴的更多相关文章
- visifire 图表双坐标轴 silverlight
public void CreateChart(Grid oGrid, ObservableCollection<ListItem> lBaseOilBar) { ...
- MATLAB绘图,绘双坐标轴,绘一图二轴等
clc; clear all; close all; % %% 画极坐标系 % x = 0:.01 * pi:0.5 * pi; % y = cos(x) + sqrt(-1) * sin(x); % ...
- Origin双坐标轴图表
1.空白处右键Add New Colume添加新列 2.全选各个列绘制图表 3.添加新的Y轴图层Graph—New Layer—Right-Y 4.右键左上角图层2 –Layer Contents 绑 ...
- matlab双坐标轴设定
clc; clear all; close all; x1 = 0:.1:40; y1 = 4 * cos(x1)./(x1 + 2); x2 = 1:.2:20; y2 = x2.^2 ./ x2. ...
- silverlight visifire控件图表制作——silverlight 后台方法画图
1.调用wcf 获取信息 private void svc_GetSingleChartDataCompleted(object sender, GetSingleChartDataCompleted ...
- Matplotlib绘图双纵坐标轴设置及控制设置时间格式
双y轴坐标轴图 今天利用matplotlib绘图,想要完成一个双坐标格式的图. fig=plt.figure(figsize=(20,15)) ax1=fig.add_subplot(111) ax1 ...
- matlab 将多个盒图放在一张图上
1.boxplot 将多个盒图放在一张图上 x1 = normrnd(5,1,100,1)';x2 = normrnd(6,1,200,1)';X = [x1 x2];G = [zeros(size( ...
- Maltab命令(随用随更新)
1.eval() ------ 将括号内的字符串视为语句并运行 比如eval('y1=sin(2)')和语句y1=sin(2)等价 多在循环中使用,可以对多个名字有规则的变量或文件进行操作,比如 fo ...
- Python画图笔记
matplotlib的官方网址:http://matplotlib.org/ 问题 Python Matplotlib画图,在坐标轴.标题显示这五个字符 ⊥ + - ⊺ ⨁,并且保存后也能显示 h ...
随机推荐
- C#字节byte类型读取与写入
//创建文件 //File.Create(@"D:\a.txt"); //Console.WriteLine("创建成功"); ////删除文件 //File. ...
- 关于sqfa
有的时候定义状态,下次来到这个状态的时候,不应该就否决掉下次,因为下次的权值可能比这次更优..
- kafka安装及Kafka-PHP扩展的使用
话说用了就要有点产出,要不然过段时间又忘了,所以在这里就记录一下试用Kafka的安装过程和php扩展的试用. 实话说,如果用于队列的话,跟PHP比较配的,还是Redis.用的顺手,呵呵,只是Redis ...
- 今日分享一点干货。PHP中课程表的实现。
首先贴代码,代码贴完再细说: 前段HTML: <div id="studentRead" class="reading" style="z-in ...
- Android用gif做启动页
公司的一个app的启动页想改为gif图,之前没有在android中加入过gif,所以赶紧饿补! 前言 我们都知道ImageView是不能完美加载Gif格式的图片,如果我们在ImageView中src指 ...
- Window Ghosting(仍可拖动失去响应的窗口,因为我们真正的窗口已经让系统用Ghosting窗口替代了。使用IsHungAppWindow 探测)
最近工作中遇到Window Ghosting这个问题, 感觉挺有意思,这里简单记录下. 在XP时代我们的程序没有响应后只能通过任务管理器强制杀掉,但是Vista之后情况变了, 我们仍然可以拖动 ...
- Jsvc安装,配置 常规用户使用tomcat的80端口
Jsvc安装 一.下载安装包,地址如下: http://commons.apache.org/proper/commonsdaemon/download_daemon.cgi 二.安装步骤,参考链接 ...
- mysql if对数据进行处理 having对数据进行查询 thinkphp中的exp支持更复杂的where查询
很多时候,数据库获取的信息并不是我们最终想要的,需要通过if进行处理. where支持查询 having支持后查询(查询后的数据,再筛选) 代码如下: if ($this->_post('dos ...
- bzoj 1192
http://www.lydsy.com/JudgeOnline/problem.php?id=1192 好像学过一个东西: [0..2^(N+1)-1]内的数都的都可以由2^0,2^1,...,2^ ...
- FutureTask 测试用例
package currentTest.BlockingQueue; import java.util.concurrent.Callable; import java.util.concurrent ...