本文实例讲述了DevExpress之ChartControl的SeriesTemplate用法,分享给大家供大家参考。具体方法如下:
关键代码如下:
namespace DevExpressChart
{
public partial class winGsp : Form
{
public winGsp()
{
InitializeComponent();
}
static readonly string AccessFullPath = string.Format(@\"{0}\\gsp.mdb\", AppDomain.CurrentDomain.BaseDirectory);
static DataTable GspList = null;
AccessUtilsV2 AccessHelper = null;
private void winGsp_Load(object sender, EventArgs e)
{
AccessHelper = new AccessUtilsV2(AccessFullPath);
GspList = AccessHelper.ExecuteDataTable(\"select * from Gsp\", null);
BuilderDevChart();
}
private void BuilderDevChart()
{
if (GspList != null)
{
chartControl1.SeriesDataMember = \"Year\";
chartControl1.SeriesTemplate.ArgumentDataMember = \"Region\";
chartControl1.SeriesTemplate.ValueDataMembers.AddRange(new string[] { \"GSP\" });
chartControl1.SeriesNameTemplate.BeginText = \"GSP in \";
chartControl1.DataSource = GspList;
chartControl1.SetXLableAngle(-35);
chartControl1.SetCrosshair(true);
chartControl1.Legend.Direction = LegendDirection.LeftToRight;
chartControl1.Legend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
chartControl1.Legend.AlignmentVertical = LegendAlignmentVertical.BottomOutside;
chartControl1.AddTitle(\"GSP List\");
}
}
}
}
本文地址:https://www.stayed.cn/item/23160
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我