msChart组件安装与编程
首先下载mschart.ocx文件,至于它所依赖的.net环境,网上有很多,本人下载的插件给出链接,http://www.cr173.com/soft/47300.html而它所依赖的环境可以从我的云盘中下载http://pan.baidu.com/s/1dETjpvj
安装好后可以通过(1)regedit注册表查看一下是否安装成功。然后注册插件:regsvr32 +path+mschart.ocx 注意:以管理员运行cmd。(2)还可以通过vs编译器查看是否存在第三方插件:打开vs-->tool-->toolbox--->com。查找

勾选就可以在vs中使用该组件了。以上是mschart的安装。下面来看一下qt环境下的demo.
/*
* @Time :2016.9.29
* @write by semon
* @显示一个2d柱状图
*/
QAxWidget *widget = new QAxWidget(this);
widget->resize(size().width()-,size().height()-);
widget->setControl(QString::fromUtf8("{31291E80-728C-11CF-93D5-0020AF99504A}")); pMsChart = new MsChart::_DMSChart(widget->asVariant().value<IDispatch*>());
pMsChart->SetTitleText("MsChart`s example");//设置标题
//设置背景颜色
pMsChart->Backdrop()->Fill()->SetStyle(MsChart::VtFillStyleBrush);
pMsChart->Backdrop()->Fill()->Brush()->FillColor()->Set(,,);
//设置SeriesType
pMsChart->setChartType(MsChart::VtChChartType3dArea);//饼图
// pMsChart->SetSeriesType(MsChart::VtChSeriesType2dLine);//2dLine
pMsChart->SetColumnCount();//y轴三条曲线
pMsChart->SetRowCount();//x轴三条曲线 //显示图例
pMsChart->SetShowLegend(true);
pMsChart->SetColumn();
pMsChart->SetColumnLabel("1号机");
pMsChart->SetColumn();
pMsChart->SetColumnLabel("2号机");
pMsChart->SetColumn();
pMsChart->SetColumnLabel("3号机");
//设置x轴
pMsChart->SetRow();
pMsChart->SetRowLabel("9.1");
pMsChart->SetRow();
pMsChart->SetRowLabel("9.2");
pMsChart->SetRow();
pMsChart->SetRowLabel("9.3");
//栈模式
pMsChart->SetStacking(false);
//y轴设置
//不自动标注x/y轴刻度
//设置成true时 y轴会自动根据熟知的额多少对y轴最大值进行修改
pMsChart->Plot()->Axis(MsChart::VtChAxisIdY)->ValueScale()->SetAuto(false);
pMsChart->Plot()->Axis(MsChart::VtChAxisIdX)->ValueScale()->SetAuto(false); //y轴最大/最小刻度
pMsChart->Plot()->Axis(MsChart::VtChAxisIdY)->ValueScale()->SetMaximum();
pMsChart->Plot()->Axis(MsChart::VtChAxisIdY)->ValueScale()->SetMinimum();
//y轴刻度等分
pMsChart->Plot()->Axis(MsChart::VtChAxisIdY)->ValueScale()->SetMajorDivision(); //每刻度一个刻度线
//y轴
pMsChart->Plot()->Axis(MsChart::VtChAxisIdY)->ValueScale()->SetMinorDivision();
//x轴
// pMsChart->Plot()->Axis(MsChart::VtChAxisIdX)->ValueScale()->SetMinorDivision(1); //y轴名称
pMsChart->Plot()->Axis(MsChart::VtChAxisIdY)->AxisTitle()->SetText("Hours");
//x轴名称
pMsChart->Plot()->Axis(MsChart::VtChAxisIdX)->AxisTitle()->SetText("Time");
//y轴名称的排列方式
pMsChart->Plot()->Axis(MsChart::VtChAxisIdY)->AxisTitle()->TextLayout()->Orientation(/**/);
//线色
pMsChart->Plot()->SeriesCollection()->Item()->Pen()->VtColor()->Set(,,);
pMsChart->Plot()->SeriesCollection()->Item()->Pen()->VtColor()->Set(,,);
pMsChart->Plot()->SeriesCollection()->Item()->Pen()->VtColor()->Set(,,);
//线宽(对点位图有效)
// pMsChart->Plot()->SeriesCollection()->Item(1)->Pen()->SetWidth(10);
// pMsChart->Plot()->SeriesCollection()->Item(2)->Pen()->SetWidth(20);
// pMsChart->Plot()->SeriesCollection()->Item(3)->Pen()->SetWidth(30);
//设置隐藏第二Y轴不可用
pMsChart->Plot()->Axis(MsChart::VtChAxisIdY2)->AxisScale()->SetHide(true);
//设置数值
pMsChart->DataGrid()->SetData(,,,);
pMsChart->DataGrid()->SetData(,,,);
pMsChart->DataGrid()->SetData(,,,);
//pMsChart->Plot()->SeriesCollection()->Item(1)->SetSecondaryAxis(false);
//数据点类型显示数据值的模式(对柱状图和点线图有效)
//0表示不显示。1显示柱状图。2显示在柱状图内上方。3显示在柱状图内中间。4显示在柱状图内下方
pMsChart->Plot()->SeriesCollection()->Item()->DataPoints()->Item(-)->DataPointLabel()->SetLocationType(MsChart::VtChLabelLocationTypeAbovePoint);
pMsChart->Plot()->SeriesCollection()->Item()->DataPoints()->Item(-)->DataPointLabel()->SetLocationType(MsChart::VtChLabelLocationTypeAbovePoint);
pMsChart->Plot()->SeriesCollection()->Item()->DataPoints()->Item(-)->DataPointLabel()->SetLocationType(MsChart::VtChLabelLocationTypeAbovePoint);
//不要与x轴垂直的表格线
pMsChart->Plot()->Axis(MsChart::VtChAxisIdX)->AxisGrid()->MajorPen()->SetStyle(MsChart::VtPenStyleNull); pMsChart->Refresh();//更新插件
效果图如下:

想要改变样式:改变setChartType的值即可。
特别鸣谢:http://blog.csdn.net/u014023993/article/details/41542717
msChart组件安装与编程的更多相关文章
- [转] .NET 3.5中MSChart组件的ImageLocation属性含义
在.NET程序/网站中如果要生成统计图表/图形,以前可以采用OWC(Office Web Components),如OfficeXP组件OWC10.Office2003组件OWC11.OWC采用COM ...
- delphi 组件安装教程详解
学习安装组件的最好方法,就是自己编写一个组件并安装一遍,然后就真正明白其中的原理了. 本例,编写了两个BPL, dclSimpleEdit.bpl 与 SimpleLabel.bpl ,其中,dc ...
- Vue总结第五天:vue-router (使用模块化(创建Vue组件)机制编程)、router-link 标签的属性、路由代码跳转、懒加载、路由嵌套(子路由)、路由传递数据、导航守卫)
Vue总结第五天:vue-router ✿ 路由(器)目录: □ vue中路由作用 □ vue-router基本使用 □ vue-router嵌套路由 □ vue-router参数传递 □ ...
- Microsoft Visual Studio Web 创作组件安装失败的解决方法
在网上查一下说是Office2007的问题.我把Office2007卸载了还是不行. 然后用Windows Install Clean Up工具清理,还是不行. 郁闷了.然后在安装包中的下面路径下找到 ...
- Gulp及组件安装构建
Gulp 是一款基于任务的设计模式的自动化工具,通过插件的配合解决全套前端解决方案,如静态页面压缩.图片压缩.JS合并.SASS同步编译并压缩CSS.服务器控制客户端同步刷新. Gulp安装 全局安装 ...
- Linux下的暴力密码在线破解工具Hydra安装及其组件安装-使用
Linux下的暴力密码在线破解工具Hydra安装及其组件安装-使用 hydra可以破解: http://www.thc.org/thc-hydra,可支持AFP, Cisco AAA, Cisco a ...
- 云计算OpenStack:云计算介绍及组件安装(一)--技术流ken
云计算介绍 当用户能够通过互联网方便的获取到计算.存储等服务时,我们比喻自己使用到了“云计算”,云计算并不能被称为是一种计算技术,而更像是一种服务模式.每个运维人员心里都有一个对云计算的理解,而最普遍 ...
- OpenStack基础组件安装keystone身份认证服务
域名解析 vim /etc/hosts 192.168.245.172 controller01 192.168.245.171 controller02 192.168.245.173 contro ...
- 一、OpenStack环境准备及共享组件安装
一.OpenStack部署环境准备: 1.关闭防火墙所有虚拟机都要操作 # setenforce 0 # systemctl stop firewalld 2.域名解析所有虚拟机都要操作 # cat ...
随机推荐
- AT指令(转)
资料来自网络 附录AT指令简编一. 一般命令1.AT+CGMI 给出模块厂商的标识.2.AT+CGMM 获得模块标识.这个命令用来得到支持的频带(GSM 900,DCS 1800 或PCS 1900) ...
- esxi 升级
开启ssh esxcli software vib install -d="/vmfs/volumes/53034105-a8b88330-c096-40f2e993407b/update- ...
- CentOS7关闭防火墙方法
在之前的版本中关闭防火墙等服务的命令是 service iptables stop /etc/init.d/iptables stop 在RHEL7中,其实没有这个服务 [root@rhel7 ~]# ...
- android studio 插件
引用于:http://www.zhihu.com/question/28026027 adb-idea 支持直接在AS面板中进行ADB操作,个人觉得太实用,上面有哥们已提及,这里再介绍下: Unins ...
- oracle基础教程(8)oracle修改字符集
oracle基础教程(8)oracle修改字符集 1.用dba连接数据库 -->sqlplus / as sysdba 2.查看字符集 -->SELECT parameter, value ...
- [转]MySQL Connector/C++(一)
http://www.cnblogs.com/dvwei/archive/2013/04/18/3029464.html#undefined#undefined MySQL Connector/C++ ...
- Add Digits, Maximum Depth of BinaryTree, Search for a Range, Single Number,Find the Difference
最近做的题记录下. 258. Add Digits Given a non-negative integer num, repeatedly add all its digits until the ...
- Django Form and Modelform Admin定义 高级查询)
Django的form表单一般具有两种功能 1. 验证输入 2.输入HTML ---------模板----------- from django import forms class BookFor ...
- 小表驱动大表, 兼论exists和in
给出两个表,A和B,A和B表的数据量, 当A小于B时,用exists select * from A where exists (select * from B where A.id=B.id) ex ...
- Linux的Service/Daemon你真的懂了吗?
一 service与一般的程序的区别 service(也称为daemon)表示后台运行的程序,一般随系统的启动自动地启动且在用户logoff后仍然能够继续运行.该daemon进程一般在启动后需要与父进 ...