Dynamicdatadisplay chart image scaling is only implemented by zooming the X axis

Source: Internet
Author: User

For example, due to project requirements, the X axis is a timeline, which is relatively long, while the Y axis value is relatively fixed, while the zoom method provided by dynamicdatadisplay enables simultaneous scaling. I had to study the source code provided by dynamicdatadisplay.

It is not difficult to find that the coordinateutilities Source Code provides the method to scale the X axis separately. The rectextensions also provides the corresponding call, but only the zoom method is called during the zoom implementation.

1. Call zoom

Public static rect zoom (this rect, point to, double ratio)
{
Return coordinateutilities. rectzoom (rect, to, ratio );
}
Directly change to (do not need to enlarge the Y axis)

Public static rect zoom (this rect, point to, double ratio)
{
// Jia Shiyi cancels Y-axis Scaling
Return coordinateutilities. rectzoomx (rect, to, ratio );
}
The test showed that although the Y axis is no longer enlarged, the height of the image is still enlarged. Source code for further research

2. the zoom method is defined in the iviewport2dextensions interface,

So try to convert vector halfsize = new vector (visible. Width * factor/2, visible. Height * factor/2)

Change Vector halfsize = new vector (visible. Width * factor/2, visible. Height/2); // * factor Jia Shiyi cancels Y-axis Scaling

Solve the problem.

 

Log on to http: // 121.18.78.216/

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.