In-depth introduction to CChart daily lesson -- lesson 12th shares the X axis view and Muslim wedding

Source: Internet
Author: User

This course is stupid to introduce you to another view with a layered function, named share X axis view.

Compared with the hierarchical view in the previous lesson, the shared X-axis view features that all layers only have one X-axis, that is, the scale of all data in the X direction is the same, in most cases, this is the case in actual problems, so I am stupid to set such a view type separately.

In fact, there is another difference, that is, sharing the title and legends of the x-axis view is shared by all layers, while the hierarchical view is drawn by each layer separately. This makes the hierarchical view sometimes look strange, and sharing the x-axis view is naturally more.

The following example describes how to share the x-axis view.

Create a VC project Lesson12 using the method of Lesson 1. The WM_CREATE response routine is as follows.

Case WM_CREATE: chartWnd. attach (hWnd, kTypeShareX); chartWnd. getChart ()-> ResizePlots (2); double pX [200], pY [200]; int I; for (I = 0; I <200; I ++) {pX [I] = I + 1; pY [I] = (I + 1) * (I + 1);} chartWnd. getChart ()-> AddCurve (pX, pY, 200, 0); for (I = 0; I <200; I ++) {pY [I] = sin (I * 2.0*3.1415926536/200.0);} chartWnd. getChart ()-> AddCurve (pX, pY, 200, 1); chartWnd. getChart ()-> SetTitle (_ T ("share X axis view"); break;

Share the x-axis view with kTypeShareX

The code is similar to that of the previous lesson. Just let the X range of the two curves be the same.

Because a mathematical library function is called, the header file must be included.

#include <math.h> 

Running effect.

650) this. width = 650; "src =" http://img.blog.csdn.net/20130919080516171? Watermark/2/text/plain =/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA =/dissolve/70/gravity/SouthEast "alt =" SouthEast "/>

The vertical axes of the two layers are placed on the left, a little unnatural.

In fact, the dumb also implements a left and right view. This is a shared X-axis view with two layers, one left and right of the vertical axis, which is very convenient to use. I will not explain it carefully here.

This course is also very simple.

The next lesson will introduce the cloud map, a companion to the contour map.

Related Article

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.