C # mschart timeline Display Effect

Source: Internet
Author: User
Tags rowcount

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 !!

 

 

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.