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.