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 双坐标轴,码迷,mamicode.com

时间: 2024-10-16 04:18:23

silverlight 双坐标轴的相关文章

visifire 图表双坐标轴 silverlight

public void CreateChart(Grid oGrid, ObservableCollection<ListItem> lBaseOilBar)        {            foreach (ListItem li in lBaseOilBar)            {                //图表大小,框线                Chart chart = new MyCharts();                chart.Width =

Python 金融数据可视化(两列数据的提取//分别画//双坐标轴//双图//两种不同的图)

import matplotlib as mpl import numpy as np import matplotlib.pyplot as plt np.random.seed(2000) y = np.random.standard_normal((20,2)) # print(y) ''' 不同的求和 print(y.cumsum()) print(y.sum(axis=0)) print(y.cumsum(axis=0)) ''' # 绘图 plt.figure(figsize=(7,

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

clc; clear all; close all; % %% 画极坐标系 % x = 0:.01 * pi:0.5 * pi; % y = cos(x) + sqrt(-1) * sin(x); % plot(y*2,'r','linewidth',5); % hold on % warning('off') % % x = pi * 0.5:0.01:pi; % y = cos(x) + sqrt(-1) * sin(x); % plot(y*2,'y','linewidth',5); %

EXCEL 图表-双坐标轴

大家在为数据做图表的时候经常会遇到数量级别很悬殊的数据.如图:这些数据并没有什么特殊之处,但是以此数据插入图表(比如柱形图)就会有些不妥之处. 大家请看下图:图例中虽然有增长率,但是图标中并没有看到.这是因为对于主坐标轴来说,数量级别相差太远了.柱坐标轴是以2000为单位,2%(0.02)的柱形对于2000来说基本不会显示在图上.那又有什么方法可以解决这一问题呢????那就是利用次坐标轴 大家可以选中数据系列:总产量的柱形并双击.会出现如下对话框.选择次坐标轴. 然后大家可以看到图表的左右两侧分

绘制双坐标轴的图形

%[AX,H1,H2]=plotyy(...):返回AX中创建的两个坐标轴的句柄以及H1和H2中每个图形绘图对象的句柄.AX(1)为左侧轴,AX(2)为右侧轴. x = 0:0.01:20; y1 = 200*exp(-0.05*x).*sin(x); y2 = 0.8*exp(-0.5*x).*sin(10*x); figure % new figure [hAx,hLine1,hLine2] = plotyy(x,y1,x,y2); title('Multiple Decay Rates')

matlab双坐标轴设定

clc; clear all; close all; x1 = 0:.1:40; y1 = 4 * cos(x1)./(x1 + 2); x2 = 1:.2:20; y2 = x2.^2 ./ x2.^3; h11 = line(x1,y1,'Color','r'); ax1 = gca; aa = get(ax1,'position'); aa(1:2) = aa(1:2) + .1; aa(3:end) = aa(3:end) - .2; % aa(1:2) = aa(1:2)+1 set(

BizCharts 双坐标轴:

https://github.com/alibaba/BizCharts/blob/master/doc/api/facet.md https://g2plot.antv.vision/zh/docs/manual/advanced/overlapped-combo-plot https://antv.gitee.io/en https://github.com/alibaba/BizCharts/issues/589 https://codepen.io/anon/pen/JmwgRQ?edi

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

1.调用wcf 获取信息 private void svc_GetSingleChartDataCompleted(object sender, GetSingleChartDataCompletedEventArgs e) { ObservableCollection<ListItem> lBaseOilBar = e.Result; CreateChart(this.gridVisifire, lBaseOilBar); } 2.构造图表 ,根据解析xml获得的ListItem 画图 pu

origin 8.5 曲线拟合,延长曲线范围

1. 输入数据并选择Y轴数据 2 非线性拟合 Analysis-Fitting-Nonlinear Curve Fit-Open Dialog 3.选择拟合曲线类型 在origin7.5中选择曲线类型和表达式比较直观,8.5好像反而不太直观了. 固定某个参数可在Parameters中设置. 点击Fit开始拟合 双击FitNL中的小图打开图像 4.延长拟合曲线范围 点击左上角小锁头图标,Change Parameters 切换回 选择Fitted Curves-Range改为Custom-去掉Au