我已经成功地使用C++示例项目来使用ZedGraph从我的C++项目中绘制图形。然而,C++的Date轴没有例子。如何使用C++和ZedGraph绘制日期轴的图形?
以下代码取自在 http://zedgraph.org/wiki/index.php?title=Tutorial:Date_Axis_Chart_Demo处找到的C#示例。请看我的评论与文本// JEM //看看我的问题在哪里
PointPairList list = new PointPairList();
for (int i=0; i<36; i++)
{
double x = (double) new XDate(1995, 5, i+11);
> //JEM //This line above doesn't work in
> C++.
double y = Math.Sin((double) i * Math.PI/15.0);
list.Add(x, y);
}
....missing code...
// Set the XAxis to date type
myPane.XAxis.Type = AxisType.Date;
//JEM //This one also doesn't work even if I change it to the
//syntax that C++ understands, that is,
myPane->XAxis->Type = AxisType->Date;
那你就带一堆C#代码,试图改变周围的符号,并使其工作?这是不可能发生的。你需要得到一个真正的C++例子并使用它。 – Puppy 2010-10-17 15:14:04
它看起来像ZedGraph只能在托管代码中使用,所以我重新标记为这样。 – 2010-10-17 15:50:19