C # mschart timeline Display Effect
In the previous C # mschart study, the X axis shows the time point, but from the perspective of the effect, the X axis does not show the start time, end time, or all the time points, now I want to make a change to display a start time point, a relative time point in the middle of the time period, and an end time point.
When you set the coordinate axis or grid line, you usually set some attributes of the area.
For example:
Area. axisx. intervalautomode = intervalautomode. fixedcount;
Area. axisx. interval = 12;
However, the time points on the timeline cannot be fixed. If the time span is too large or too small, the start, center, and end time points cannot be displayed.
First, let's take a look at what has been implemented (not perfect, but there are minor problems ):
Figure 1:
Figure 2:
In Figure 1, we can clearly see the start time and end time, but the time in the middle is not definitely between the start time and the end time. In Figure 2, we can only see the start time, the End Time is moved to the second-to-last data point.
In fact, it is very simple. Here is the effect code for the above two figures after I set them:
# Region if (rowcount> = 11) {newchart. chartareas [0]. axisx. interval = (rowcount-1)/2; // dynamically set the interval of the axis (interval) here
Series. isxvalueindexed = true;} else {series. isxvalueindexed = false; // whether to use the data point index for the X value} # endregion
Rowcount indicates the number of bound data records.
For more information about data binding, see C # mschart in my previous article.
In this way, the end time is still not displayed in Figure 2. If any of you have a solution to this problem, please kindly advise. Thank you !!