/// ----------------------------------------------------------------
/// 文 件 名:ChartControl.cs
/// 功能描述:图表管理
///
/// 创建标识:Jdragon 2011-11-22
/// ----------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms.DataVisualization.Charting;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;
using SunVoteARSPPT;
namespace GeneralLib
{
///
/// 枚举类型(自定义枚举类型)
///
public enum ChartTypes
{
///
/// 柱形图
///
ctColumn,
///
/// 条形图
///
ctBar,
///
/// 垂直方块图 杨斌 2014-04-22
///
ctColumnBox,
///
/// 水平方块图 杨斌 2014-04-22
///
ctBarBox,
///
/// 饼图
///
ctPie,
///
/// 文本
///
ctText,
}
///
/// 标签类型
///
public enum LabelTypes
{
// 无标签
ltNone,
// 数值
ltNumberValue,
// 百分比
ltPercent,
// 数值加百分比
ltNumberValueAndPercent,
}
///
/// 图例样式
///
public enum LegendStyles
{
///
/// 列方式
///
lsColumn = 0,
///
/// 行方式
///
lsRow = 1,
///
/// 表格方式
/// 杨斌 2014-02-25
///
lstTable = 2
}
///
/// 图例对齐方式
///
public enum LegentAlignments
{
///
/// 靠近布局对齐。在左到右布局中,近端位置是左。在右到左布局中,近端位置是右。
///
laNear = 0,
///
/// 居中对齐
///
laCenter = 1,
///
/// 指定文本远离布局矩形的原点位置对齐。在左到右布局中,远端位置是右。在右到左布局中,远端位置是左。
///
laFar = 2
}
///
/// 图例位置
///
public enum LegentDockings
{
///
/// 上
///
ldTop = 0,
///
/// 右
///
ldRight = 1,
///
/// 下
///
ldBottom = 2,
///
/// 左
///
ldLeft = 3
}
public class ManageChart
{
///
/// 微软控件属性
///
public Chart MsChart { get; set; }
///
/// 图表类型(默认值:柱形图)
///
private ChartTypes chartType = ChartTypes.ctColumn;
///
/// 图表类型
///
public ChartTypes ChartType
{
get
{
return chartType;
}
set
{
chartType = value;
}
}
///
/// 文本模式图表数据按行排列
///
public bool TextChartTypeByLine = false;
///
/// 只显示文本的图表形式,数字和选项之间的空格(水平)或空行(垂直)数。杨斌 2019-04-03
///
public int ChartTypeTextSpaceOrLine = 0;
///
/// 图表宽度,默认为320
///
private int width = 320;
public int Width
{
get
{
return width <= 0 ? 320 : width;
}
set
{
if (value <= 0)
throw (new ApplicationException("Abnormal width of the chart, the width must be greater than 0"));
width = (value <= 0) ? 320 : value;
}
}
///
/// 图表高度,默认为240
///
private int height = 240;
public int Height
{
get
{
return height <= 0 ? 240 : height;
}
set
{
if (value <= 0)
throw (new ApplicationException("Degree of abnormal length of the chart, the width must be greater than 0"));
height = (value <= 0) ? 240 : value;
}
}
///
/// X轴值(选择项)
///
public string[] XValue { get; set; }
///
/// Y轴值集合
///
public List YValues { get; set; }
///
/// Y轴值集合。Angage定制不按标准如权重,按投票人数,与百分比分离。杨斌 2019-11-26
///
public List YValuesNew { get; set; }
///
/// 数据标签(默认值:数值)
///
private LabelTypes labelType = LabelTypes.ltNumberValue;
public LabelTypes LabelType
{
get
{
return labelType;
}
set
{
labelType = value;
}
}
///
/// 2014-03-17 增加标签小数位数
///
public int NumberDec = 0;
public int PercentDec = 1;
private double labelDenominator = 0;
///
/// 百分比标签的分母,为0时表示以总数量计算,默认为0
///
public double LabelDenominator
{
get
{
return labelDenominator;
}
set
{
if (value < 0)
throw (new ApplicationException("Percentage of the label must be greater than or equal to 0 denominator"));
labelDenominator = value;
}
}
///
/// 分母计算选项限制,如三键表决按赞成反对。默认0为所有选项。
/// 杨斌 2015-06-18
///
public int LabelDenominatorOptionLimit = 0;
///
/// 计算系列总数值
///
/// 系列
/// 总数值
private int SumPointsValue(Series series)
{
int value = 0;
//杨斌 2015-06-18
int count = series.Points.Count;
if ((this.LabelDenominatorOptionLimit > 0)
&& (this.LabelDenominatorOptionLimit < series.Points.Count))
{
count = this.LabelDenominatorOptionLimit;
}
for (int i = 0; i < count; i++)//杨斌 2015-06-18
{
value = value + (int)series.Points[i].GetValueByName("Y");
}
return value;
}
///
/// 杨斌 2012-06-29
///
public Color[] SeriesColorsInit =
{
Color.FromArgb(65, 140, 240),
Color.FromArgb(224, 64, 10),
Color.FromArgb(252, 180, 65),
Color.FromArgb(5, 100, 146),
Color.FromArgb(191, 191, 191),
Color.FromArgb(26, 59, 105),
Color.FromArgb(255, 227, 130),
Color.FromArgb(18, 156, 221),
Color.FromArgb(202, 107, 75),
Color.FromArgb(0, 92, 219)
};
///
/// 系列(Series)颜色
/// 修改:杨斌 2012-06-28
///
public Color[] SeriesColors
{
get
{
//return seriesColors;
Color[] aryColors = new Color[9999];
int count = SeriesColorsInit.Length;
for (int i = 0; i < aryColors.Length; i++)
{
int n = i % count;
aryColors[i] = SeriesColorsInit[n];
}
return aryColors;
}
set
{
SeriesColorsInit = value;
if (value == null || value.Length < 0)
throw (new ApplicationException("Series (Series) colors set at least one color"));
}
}
///
/// Point颜色
///
public Color[] PointColors { get; set; }
//杨斌 2014-06-04。默认改为0
private double pointWidth = 0;//必须设置,因为默认为0。图表控件应默认设置为1,否则默认为0时图表柱状图画不出来 2012-02-02
///
/// 系列各项的宽度,必须0-1之间,0表示默认
///
public double PointWidth
{
get
{
return pointWidth;
}
set
{
if (value < 0 || value > 1)
throw (new ApplicationException("The width of the series, must be between 0-1"));
pointWidth = (value < 0 || value > 1) ? 1 : value;
}
}
///
/// 是否显示图例
///
private bool legendEnable = true;
public bool LegendEnable
{
get
{
return legendEnable;
}
set
{
legendEnable = value;
}
}
private LegendStyles legendStyle = LegendStyles.lsColumn;
///
/// 图例样式
///
private LegendStyles LegendStyle
{
get
{
return legendStyle;
}
set
{
legendStyle = value;
}
}
private Font legendFont = new Font("Arial", 8);
///
/// 图例文本格式,如字体、字号、字形属性
///
private Font LegendFont
{
get
{
return legendFont;
}
set
{
legendFont = value;
}
}
private LegentAlignments legendAlignment = LegentAlignments.laCenter;
///
/// 图例对齐方式,默认居中对齐
///
public LegentAlignments LegendAlignment
{
get
{
return legendAlignment;
}
set
{
legendAlignment = value;
}
}
private LegentDockings legentDocking = LegentDockings.ldBottom;
///
/// 图例位置
///
public LegentDockings LegentDocking
{
get
{
return legentDocking;
}
set
{
legentDocking = value;
}
}
private Color legentForeColor = Color.Black;
///
/// 图例文本颜色
///
public Color LegentForeColor
{
get
{
return legentForeColor;
}
set
{
legentForeColor = value;
}
}
///
/// 图例文本
///
public string[] LegentText { get; set; }
///
/// 是否3D图
///
private bool is3D = false;
public bool Is3D
{
get
{
return is3D;
}
set
{
is3D = value;
}
}
private bool axisYEnable = false;
///
/// 是否显示Y轴,默认显示
///
private bool AxisYEnabled
{
get
{
return axisYEnable;
}
set
{
axisYEnable = value;
}
}
private bool axisXEnable = true;
private int iChangeColor = 0; //0:初始值,1:Bar图,2:Other图 20120204
private int iChiceCount = 0; //记录Bar图选项选项个数(Bar图时记录) 20120204
///
/// 是否显示X轴,默认显示
///
public bool AxisXEnabled
{
get
{
return axisXEnable;
}
set
{
axisXEnable = value;
}
}
///
/// 柱状图的最大值
///
private int maxValue = 0;
public int MaxValue
{
get
{
return maxValue;
}
set
{
maxValue = value;
}
}
private Font dataLabelFont = new Font("Arial", 14);
///
/// 数据标签字体
/// 创建:杨斌 2012-06-26
///
public Font DataLabelFont
{
get { return dataLabelFont; }
set { dataLabelFont = value; }
}
///
/// 是否使用系统字体
/// 杨斌 2015-05-29
///
public bool UseSystemFont = true;
private Color dataLabelColor = Color.Black;
///
/// 数据标签颜色
/// 创建:杨斌 2012-06-26
///
public Color DataLabelColor
{
get { return dataLabelColor; }
set { dataLabelColor = value; }
}
private Font itemLabelFont = new Font("Arial", 16);
///
/// 选项标签字体
/// 创建:杨斌 2012-06-26
///
public Font ItemLabelFont
{
get { return itemLabelFont; }
set { itemLabelFont = value; }
}
private Color itemLabelColor = Color.Black;
///
/// 选项标签颜色
/// 创建:杨斌 2012-06-26
///
public Color ItemLabelColor
{
get { return itemLabelColor; }
set { itemLabelColor = value; }
}
///
/// 图表最大数据值,用于柱状图或条形图最大长度设置
/// 若为0则长度自动适应
/// 创建:杨斌 2013-02-21
///
public double MaxDataValue = 0;
///
/// 是否强制显示选项文本
/// 杨斌 2015-01-08
///
//public bool ShowItemText = false;
///
/// 使用堆积图
/// 杨斌 2014-11-04
///
public bool UseStacked = false;
///
/// 在使用UseStacked堆积图基础上,使用100堆积图
/// 杨斌 2017-06-13
///
public bool UseStacked100 = false;
///
/// 图表标题。杨斌 2017-03-21
///
public string ChartTitle = "";
public bool UpdateChart2(Dictionary optionTextFull = null)
{
string titleSlide = "";
if (MsChart.Titles.Count > 0)
{
titleSlide = MsChart.Titles[0].Text;
}
//清除图表(区域)
MsChart.ChartAreas.Clear();
MsChart.Series.Clear();
MsChart.Titles.Clear();
MsChart.Legends.Clear();
//图表、字体清晰度(锯齿)
MsChart.AntiAliasing = AntiAliasingStyles.Graphics;
//图表背景色
MsChart.BackColor = Color.Transparent;
//图表位置
MsChart.Location = new System.Drawing.Point(0, 0);
//图表大小
MsChart.Size = new System.Drawing.Size(this.width, this.height);
if (titleSlide.Length < 1)
titleSlide = "Group Comparison";
Title ti = new Title(titleSlide, Docking.Top);
ti.Name = "Title";
ti.Alignment = ContentAlignment.MiddleCenter;
ti.ForeColor = Color.Black;
ti.Font = new Font(ItemLabelFont.Name, ItemLabelFont.Size, ItemLabelFont.Style);
MsChart.Titles.Add(ti);
string foot = "";
if ((optionTextFull != null) && (optionTextFull.Count > 0))
{
int nItem = 0;
foreach (var v in optionTextFull)
{
nItem++;
foot += v.Key + "." + v.Value + "; ";
}
}
ti = new Title(foot, Docking.Bottom);
ti.Name = "Foot";
ti.Alignment = ContentAlignment.MiddleLeft;
ti.ForeColor = Color.Black;
ti.Font = new Font(ItemLabelFont.Name, ItemLabelFont.Size, ItemLabelFont.Style);
MsChart.Titles.Add(ti);
int groupCount = this.YValues.Count;
int yStart = 10;
int hStep = 80;
int xStart = 5;
int wStep = (100 - xStart) / groupCount;
ChartArea area = null;
Series ser = null;
for (int i = 1; i <= groupCount; i++)
{
area = new ChartArea("Area" + i);
area.Position.Auto = false;
area.Position = new ElementPosition(xStart, yStart, wStep, hStep);
area.BackColor = Color.Transparent;
MsChart.ChartAreas.Add(area);
xStart += wStep;
ser = new Series("Series" + i);
ser.ChartArea = area.Name;
ser.IsValueShownAsLabel = true;
ser.ChartType = SeriesChartType.Bar;
MsChart.Series.Add(ser);
string sGroup = LegentText[i - 1];
ti = new Title(sGroup, Docking.Top);
ti.Name = "Title" + i;
ti.Alignment = ContentAlignment.TopLeft;
ti.DockedToChartArea = area.Name;
//ti.DockingOffset = 7;
//ti.IsDockedInsideChartArea = false;
ti.ForeColor = Color.Black;
ti.Font = new Font(LegendFont.Name, 12, LegendFont.Style);
MsChart.Titles.Add(ti);
}
area = new ChartArea("AreaRank");
area.Position.Auto = false;
area.Position = new ElementPosition(0, yStart, 50, hStep);
area.BackColor = Color.Transparent;
MsChart.ChartAreas.Add(area);
ser = new Series("SeriesRank");
ser.ChartArea = "AreaRank";
ser.IsValueShownAsLabel = false;
ser.ChartType = SeriesChartType.Bar;
MsChart.Series.Add(ser);
string rankTi = GlobalInfo.SysLanguage.LPT.ReadString("Other", "OrderGroupChartRank", "Avg.\r\nRanking");
ti = new Title(rankTi, Docking.Top);
ti.Name = "Rank";
ti.Alignment = ContentAlignment.TopLeft;
ti.DockedToChartArea = "AreaRank";
ti.DockingOffset = 4;
ti.IsDockedInsideChartArea = false;
ti.ForeColor = Color.Black;
MsChart.Titles.Add(ti);
//如果是条形图,反转数据,颜色翻转 杨斌 2014-03-21
if ((this.chartType == ChartTypes.ctBar) ||
(this.chartType == ChartTypes.ctBarBox) ||
(this.chartType == ChartTypes.ctText))//杨斌 2015-04-20
{
//杨斌 2014-12-09
string tempXVal;
double tempYVal;
int count = XValue.Length;
for (int j = 0; j < count / 2; j++)
{
tempXVal = XValue[j];
XValue[j] = XValue[count - 1 - j];
XValue[count - 1 - j] = tempXVal;
}
for (int i = 0; i < YValues.Count; i++)
{
count = YValues[i].Length;
for (int j = 0; j < count / 2; j++)
{
//tempXVal = XValue[j];
//XValue[j] = XValue[count - 1 - j];
//XValue[count - 1 - j] = tempXVal;
tempYVal = YValues[i][j];
YValues[i][j] = YValues[i][count - 1 - j];
YValues[i][count - 1 - j] = tempYVal;
}
}
}
groupCount++;
for (int y = 0; y < groupCount; y++)
{
//创建图表区域
ChartArea chartArea = MsChart.ChartAreas[y];
chartArea.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.True;//是否显示x轴
chartArea.AxisY.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;//是否显示y轴
//X/Y轴网格线
chartArea.AxisX.MajorGrid.LineDashStyle = ChartDashStyle.NotSet;
chartArea.AxisY.MajorGrid.LineDashStyle = ChartDashStyle.NotSet;
chartArea.AxisX.MajorGrid.Enabled = false;
chartArea.AxisX.MajorTickMark.Enabled = false;
chartArea.AxisX.LineColor = Color.Transparent;
chartArea.AxisX.LabelStyle.Interval = 1;//解决图表显示13 5 7 9 11问题
//数据列是否聚合
chartArea.Area3DStyle.IsClustered = false;// this.ChartParam.IsClustered;
//图表区域背景色
chartArea.BackColor = Color.Transparent;
//X/Y轴标签文本颜色
chartArea.AxisY.LabelStyle.ForeColor = Color.Black;
chartArea.AxisX.LabelStyle.ForeColor = ItemLabelColor;//Color.Black;//杨斌 2012-06-26
//系列各项深度,3D时有效,取值0-1000之间,默认60
chartArea.Area3DStyle.PointDepth = 60;// this.ChartParam.PointDepth;
//系列各项前后空白的深度,3D时有效,取值0-1000之间,默认100
chartArea.Area3DStyle.PointGapDepth = 100;// this.ChartParam.PointGapDepth;
//杨斌 2016-05-13
//chartArea.BorderDashStyle = ChartDashStyle.Solid;
//chartArea.BorderColor = Color.Red;
chartArea.AlignmentOrientation = AreaAlignmentOrientations.Vertical;
if (chartArea.Name == "AreaRank")
{
chartArea.BorderColor = Color.Transparent;
chartArea.BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.NotSet;
//cha.Series[i].Points.DataBindXY(aryItemR, aryValueR);
}
else
{
chartArea.BorderColor = Color.Black;
chartArea.BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid;
}
if (iChangeColor == 1 && iChiceCount > 1) // 颜色翻转-颜色还原 --解决由5个选项变成7个选项颜色会变的bug jdragon -2012-02-06
{
Color[] tempColors = this.SeriesColors;
Color tempColor;
for (int j = 0; j < iChiceCount / 2; j++)
{
tempColor = tempColors[iChiceCount - 1 - j];
tempColors[iChiceCount - 1 - j] = tempColors[j];
tempColors[j] = tempColor;
}
this.SeriesColors = tempColors;
iChangeColor = 2;
}
//组内排序。杨斌 2016-05-17
////如果是条形图,反转数据,颜色翻转 杨斌 2014-03-21
//if ((this.chartType == ChartTypes.ctBar) ||
// (this.chartType == ChartTypes.ctBarBox) ||
// (this.chartType == ChartTypes.ctText))//杨斌 2015-04-20
//{
// //杨斌 2014-12-09
// string tempXVal;
// double tempYVal;
// int count = XValue.Length;
// for (int j = 0; j < count / 2; j++)
// {
// tempXVal = XValue[j];
// XValue[j] = XValue[count - 1 - j];
// XValue[count - 1 - j] = tempXVal;
// }
// for (int i = 0; i < YValues.Count; i++)
// {
// count = YValues[i].Length;
// for (int j = 0; j < count / 2; j++)
// {
// //tempXVal = XValue[j];
// //XValue[j] = XValue[count - 1 - j];
// //XValue[count - 1 - j] = tempXVal;
// tempYVal = YValues[i][j];
// YValues[i][j] = YValues[i][count - 1 - j];
// YValues[i][count - 1 - j] = tempYVal;
// }
// }
//}
//找到最大数据值,方便设置柱状图最大高度。杨斌 2012-04-11
double yValueMax = maxValue;
//for (int i = 0; i < this.YValues.Count; i++)
//{
// double[] YVals = this.YValues[i];
// for (int j = 0; j < YVals.Length; j++)
// {
// if (YVals[j] > yValueMax)
// yValueMax = YVals[j];
// }
//}
if (this.YValues.Count > 1)//杨斌 2014-11-04
{
if (UseStacked)
{
for (int j = 0; j < this.YValues[0].Length; j++)
{
double count = 0;
for (int i = 0; i < this.YValues.Count; i++)
{
count += this.YValues[i][j];
}
if (count > yValueMax)
yValueMax = count;
}
}
else
{
for (int i = 0; i < this.YValues.Count; i++)
{
double[] YVals = this.YValues[i];
for (int j = 0; j < YVals.Length; j++)
{
if (YVals[j] > yValueMax)
yValueMax = YVals[j];
}
}
}
}
else
{
for (int i = 0; i < this.YValues.Count; i++)
{
double[] YVals = this.YValues[i];
for (int j = 0; j < YVals.Length; j++)
{
if (YVals[j] > yValueMax)
yValueMax = YVals[j];
}
}
}
//创建数据系列
//for (int i = 0; i < this.YValues.Count; i++)
//{
Series series = MsChart.Series[y];
//DrawingStyle取值范围:Cylinder 、Emboss、LightToDark、Wedge、Default。杨斌 2014-04-18
//series.ChartArea = this.MsChart.ChartAreas[y].Name;
this.LegendStyle = LegendStyles.lsColumn;
////图表类型
//switch (this.chartType)
//{
// case ChartTypes.ctColumn:
// case ChartTypes.ctColumnBox:
// //series.ChartType = SeriesChartType.Column;
// if ((this.YValues.Count > 1) && UseStacked)//杨斌 2014-11-04
// {
// series.ChartType = SeriesChartType.StackedColumn;
// //this.LegendStyle = LegendStyles.lstTable;
// this.LegendStyle = LegendStyles.lsColumn;
// }
// else
// {
// series.ChartType = SeriesChartType.Column;
// this.LegendStyle = LegendStyles.lsColumn;
// }
// //系列效果 杨斌 2014-11-04
// if (this.chartType == ChartTypes.ctColumn)
// series["DrawingStyle"] = "Cylinder"; // 圆柱
// else
// series["DrawingStyle"] = "Default";
// //if (iChangeColor == 1 && iChiceCount > 1) // 颜色翻转(上次是Bar时颜色时翻转) -jdragon 20120204
// //{
// // Color[] tempColors = this.SeriesColors;
// // Color tempColor;
// // for (int j = 0; j < iChiceCount / 2; j++)
// // {
// // tempColor = tempColors[iChiceCount - 1 - j];
// // tempColors[iChiceCount - 1 - j] = tempColors[j];
// // tempColors[j] = tempColor;
// // }
// // this.SeriesColors = tempColors;
// //}
// //iChangeColor = 2;
// break;
// case ChartTypes.ctBar:
// case ChartTypes.ctBarBox:
// case ChartTypes.ctText://杨斌 2015-04-20
// //series.ChartType = SeriesChartType.Bar;
// if ((this.YValues.Count > 1) && UseStacked)//杨斌 2014-11-04
// {
// series.ChartType = SeriesChartType.StackedBar;
// //this.LegendStyle = LegendStyles.lstTable;
// this.LegendStyle = LegendStyles.lsColumn;
// }
// else
// {
// series.ChartType = SeriesChartType.Bar;
// this.LegendStyle = LegendStyles.lsColumn;
// }
// //系列效果 杨斌 2014-11-04
// if (this.chartType == ChartTypes.ctBar)
// series["DrawingStyle"] = "Cylinder"; // 圆柱
// else
// series["DrawingStyle"] = "Default";
// ////颜色翻转--20120202
// //string[] XValsTemp = this.XValue;
// //if (iChangeColor != 1) //颜色翻转
// //{
// // Color[] tempColors = this.SeriesColors;
// // int count = XValsTemp.Length;
// // iChiceCount = XValsTemp.Length;
// // Color tempColor;
// // for (int j = 0; j < count / 2; j++)
// // {
// // tempColor = tempColors[count - 1 - j];
// // tempColors[count - 1 - j] = tempColors[j];
// // tempColors[j] = tempColor;
// // }
// // this.SeriesColors = tempColors;
// // iChangeColor = 1;
// //}
// break;
// //case ChartTypes.ctColumnBox://杨斌 2014-04-22
// // series.ChartType = SeriesChartType.Column;
// // //系列效果
// // series["DrawingStyle"] = "Default";
// // break;
// //case ChartTypes.ctBarBox://杨斌 2014-04-22
// // series.ChartType = SeriesChartType.Bar;
// // //系列效果
// // series["DrawingStyle"] = "Default";
// // break;
// case ChartTypes.ctPie://PieDrawingStyle范围:Default、SoftEdge、Concave
// series.ChartType = SeriesChartType.Pie;
// //系列效果
// series["PieDrawingStyle"] = "Default";//默认
// //if (iChangeColor == 1 && iChiceCount > 1) // 颜色翻转(上次是Bar时颜色时翻转) -jdragon 20120204
// //{
// // Color[] tempColors = this.SeriesColors;
// // Color tempColor;
// // for (int j = 0; j < iChiceCount / 2; j++)
// // {
// // tempColor = tempColors[iChiceCount - 1 - j];
// // tempColors[iChiceCount - 1 - j] = tempColors[j];
// // tempColors[j] = tempColor;
// // }
// // this.SeriesColors = tempColors;
// //}
// //iChangeColor = 2;
// break;
//}
//不显示柱状图。杨斌 2015-04-20
////series.Points.DataBindXY(this.XValue, this.YValues[i]);
double[] zeroVal = new double[this.YValues[0].Length];//杨斌 2016-05-17
if (chartArea.Name == "AreaRank")//杨斌 2016-05-17
{
int itemCount = zeroVal.Length;
string[] aryItemR = new string[itemCount];
double[] aryValueR = new double[itemCount];
for (int n = 0; n < itemCount; n++)
{
aryItemR[n] = (aryItemR.Length - n).ToString();
}
series.Points.DataBindXY(aryItemR, aryValueR);
}
else
{
//排序处理。杨斌 2016-05-17
List