OpenFlashChart数据源

关于OpenFlashChart数据源的问题,
比如我想让x轴的数据源是从1-50,而我现在想把绘图的数据想与x轴数据对应,例如,(5,20)(8,25)(10,30)...
下面的代码只能实现把x轴的第一个刻度是5,第二个是8,第三个是10

IList<String> ilist1 = new List<String>();
  for(int i=0;i<dt1.Rows.Count;i++)
  {
  arrayList1.Add(Convert.ToDouble( dt1.Rows["MinH"]));
  arrayList2.Add(Convert.ToDouble(dt1.Rows["MaxH"]));
  ilist1.Add(dt1.Rows["Month"].ToString());
  }

 OpenFlashChart.LineHollow line1 = new LineHollow();
  line1.Values = arrayList2;
  line1.HaloSize = 0;
  line1.Width = 1;
  line1.DotSize = 1;
  line1.Tooltip = "提示:#val#";
  chart.AddElement(line1);


XAxis xaxis = new XAxis();
  xaxis.Labels.SetLabels(ilist1);
  xaxis.Steps = 2;
  xaxis.SetRange(0, 60);
  chart.X_Axis = xaxis;


chart.Title = new Title("line演示");
  ofc1.EnableCache = false;
  ofc1.Chart = chart;
posted @ 2011-06-16 23:01  天水一阶  阅读(138)  评论(0)    收藏  举报