Mschart Installation and Use

Source: Internet
Author: User

Recently, the mschart control has been used to search for some materials on the Internet.

 

 

 

 

Recently, I need to display some bar charts, line charts, and so on for the program. I checked Microsoft's mschart, which is good and powerful. However, the mschart control is removed from the MS ide after vc6.0. If you use it, you can only download and install it yourself. Mschart installation required

1. Net framewrok 3.5 SP1 (note that it is SP1). If it is not installed, download it. The complete package is more than 200 MB.

2. Install mschart.exe mschart_visualstudioaddon.exe to download mschrt1_ocx to the C:/Windows/system32 directory. Run the regsvr32 mschrt1_ocx command to register the control.

3 on the platform after vs2005, you either add class-> MFC class from ActiveX control under the Class View, and then there are two options. You can select registy and then select Ms mschart 6.0 (OLED ), in this way, only one class cmschart can appear, or you can select file and then browse mschrt1_ocx. Many classes are generated here. You can add all the classes and use them.

2. You can insert axtivex control or select Choose item-> COM in the toolbox on an MFC dialog to display the component in the toolbox. In this way, you can also have a control.

We choose to generate many classes by ourselves, which are different from the class function names on the Internet, which may cause troubles. In fact, the simplest thing is to find a demo and copy the related cmschart and more than a dozen other related classes in it to my project folder. Then, we can add them.

Many examples on the Internet for reference, such as: http://www.vckbase.com/document/viewdoc? Id = 959

Some problems encountered. When setting the graph type, m_chart.setcharttype (1 | 2); the 2D graph is displayed, while m_chart.setcharttype (16) is used. If you set only m_chart.setcolumncount (1 ); it will not be displayed, because the 16 hash chart requires a pair of coordinate points, you must at least set m_chart.setcolumncount (2); to 2.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.