我已經成功地使用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