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 双坐标轴的更多相关文章

  1. visifire 图表双坐标轴 silverlight

    public void CreateChart(Grid oGrid, ObservableCollection<ListItem> lBaseOilBar)        {       ...

  2. MATLAB绘图,绘双坐标轴,绘一图二轴等

    clc; clear all; close all; % %% 画极坐标系 % x = 0:.01 * pi:0.5 * pi; % y = cos(x) + sqrt(-1) * sin(x); % ...

  3. Origin双坐标轴图表

    1.空白处右键Add New Colume添加新列 2.全选各个列绘制图表 3.添加新的Y轴图层Graph—New Layer—Right-Y 4.右键左上角图层2 –Layer Contents 绑 ...

  4. matlab双坐标轴设定

    clc; clear all; close all; x1 = 0:.1:40; y1 = 4 * cos(x1)./(x1 + 2); x2 = 1:.2:20; y2 = x2.^2 ./ x2. ...

  5. silverlight visifire控件图表制作——silverlight 后台方法画图

    1.调用wcf 获取信息 private void svc_GetSingleChartDataCompleted(object sender, GetSingleChartDataCompleted ...

  6. Matplotlib绘图双纵坐标轴设置及控制设置时间格式

    双y轴坐标轴图 今天利用matplotlib绘图,想要完成一个双坐标格式的图. fig=plt.figure(figsize=(20,15)) ax1=fig.add_subplot(111) ax1 ...

  7. matlab 将多个盒图放在一张图上

    1.boxplot 将多个盒图放在一张图上 x1 = normrnd(5,1,100,1)';x2 = normrnd(6,1,200,1)';X = [x1 x2];G = [zeros(size( ...

  8. Maltab命令(随用随更新)

    1.eval() ------ 将括号内的字符串视为语句并运行 比如eval('y1=sin(2)')和语句y1=sin(2)等价 多在循环中使用,可以对多个名字有规则的变量或文件进行操作,比如 fo ...

  9. Python画图笔记

    matplotlib的官方网址:http://matplotlib.org/ 问题 Python Matplotlib画图,在坐标轴.标题显示这五个字符 ⊥ + - ⊺ ⨁,并且保存后也能显示   h ...

随机推荐

  1. C#--virtual,abstract,override,new,sealed

    virtual:使用此关键字,可以使其在派生类中被重写. abstract:抽象方法,由子类重写,或继续为抽象方法存在,并由其子子类实现. override: 重写父类方法,属性,或事件的抽象实现或虚 ...

  2. POJ 3630 , HDU 1671 Phone List - from lanshui_Yang

    这道题也是一道找前缀的问题,很自然地要用到Trie树,但是如果用动态Trie树(即用指针开辟内存)的话,虽然在HDU上可以过(可能是HDU的数据比较水),但在POJ上会TLE , 所以这道题只能用静态 ...

  3. polygonZM---> poliygon

    ArcToolbox > Conversion Tools > To Shapefile > Feature Class To Shapefile (multiple)   Clic ...

  4. Django Meta内部类选项

    http://blog.csdn.net/yelbosh/article/details/7545335

  5. AJAX 跨域

    1.说到ajax就会遇到的两个问题 1.1AJAX以何种格式来交换数据                    1.自定义字符串 2.XML描述 3.JSON描述(建议使用)          1.2如 ...

  6. .NET MVC权限控制

    一.模块 权限控制的主体单位,与MVC里的Cotroller相对应. 二.模块权限 权限控制的最小单位,通过给每一个模块设置权限,可以控制到非常细小的功能. 三.角色 权限拥有者,通过给不同的角色分配 ...

  7. python sqlite3使用

    python sqlite3文档地址:http://docs.python.org/2/library/sqlite3.html The sqlite3 module was written by G ...

  8. webservice的几个简单概念

    1.什么是JAX-WS? http://baike.baidu.com/view/1865210.htm?fr=aladdin 2.什么是JAX-RPC? http://baike.baidu.com ...

  9. 【转】VC中TRACE

    原文网址:http://blog.csdn.net/yangsen2016/article/details/1636996 TRACE宏对于VC下程序调试来说是很有用的东西,有着类似printf的功能 ...

  10. FROM CSDN TO CNBLOGS

    做出了一个愉快的决定,以后会将博客从CSDN迁移到CNBLOGS 旧地址:http://blog.csdn.net/fifa0329,文章并不多 原因如下: 我再次出现了该博客违反了网站规则被关闭的问 ...