VS2010使用MSChart控件

来源:互联网 发布:国药种业淘宝 编辑:程序博客网 时间:2024/05/17 21:57

1、将mschrt20.ocx放入system32中,并注册

2、添加ActiveX控件: Tools->choose toolbox items->COM components  选择Microsoft chart control

3、添加类 Project->Addclass ->MFC class from Typelib 选择 Microsoft chart control 。这时工程中会生成许多CVc开头的头文件。

4、使用时添加

#import <msdatsrc.tlb> no_namespace  #import <mschrt20.ocx> no_namespace 

引用相关头文件

#include "CVcPlot.h"#include "CVcAxis.h"#include "CVcValueScale.h"#include "CVcSeriesCollection.h"#include "CVcSeries.h"#include "CVcPen.h"#include "CVcCategoryScale.h"#include "CVcColor.h"#include "CVcDataGrid.h"#include "CVcBackdrop.h"#include "CVcFill.h"#include "CVcBrush.h"#include "CVcDataPoints.h"#include "CVcDataPoint.h"#include "CVcDataPointLabel.h"#include "CVcAxisTitle.h"#include "CVcAxisScale.h"#include "CVcAxisGrid.h"#include "CVcFont.h"#include "CVcTitle.h"



原创粉丝点击