ZedGraph 在MFC中的使用(一)

网上有 C#和CLR使用ZedGraph的例子,使用MFC操作会有变化。

http://blog.csdn.net/tjvictor/article/details/1412540参照这个例子本人将其改为MFC的代码。

m_ChartCtrl在上一篇中定义好的……

 

 GraphPane ^myPane = m_ChartCtrl->GraphPane;
 myPane->Title->Text = "My Initial Graph Sample Demo\n(For CodeProject Sample)"; 
 myPane->XAxis->Title->Text = "My X Axis";
 myPane->YAxis->Title->Text = "My Y Axis";

 PointPairList ^list1 = gcnew PointPairList(); 
 PointPairList ^list2 = gcnew PointPairList(); 
 for ( int i=0; i<36; i++ ) 
 { 
  double x = (double) i + 5; 
  double y1 = 1.5 + sin((double) i * 0.2 ); 
  double y2 = 3.0 * ( 1.5 + sin((double) i * 0.2 ) ); 
  list1->Add( x, y1 ); 
  list2->Add( x, y2 ); 
 }

 // Generate a red curve with diamond
    // symbols, and "Porsche" in the legend
 LineItem ^myCurve = myPane->AddCurve("Porsche",list1,Color::Red,SymbolType::Diamond);
 
 // Generate a blue curve with circle
 // symbols, and "Piper" in the legend
 LineItem ^myCurve2 = myPane->AddCurve("Piper",list2,Color::Blue,SymbolType::Circle );

 m_ChartCtrl->AxisChange();

 

许多操作 要使用 “^”,相当于引用(或者当指针来用),本人测试时发现,不使用“^”方式,可能出不来正确的结果!

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值