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.