Flex Chart selection area scaling code

Source: Internet
Author: User

Function:

  1. Drag a rectangle on the Chart to scale one or more data series;
  2. Double-click on the Chart to restore the status before scaling.

Click hereView the effect of this instance,Click hereDownload the source code of this instance.

In essence, we only obtain a new dataProvider through region selection, and then provide the Chart to simulate Chart scaling. Two tips are worth mentioning:

  1. Use the ChartItemEvent Change event instead of the itemMouseUp event to avoid scaling the Chart when dragging and selecting the blank space.
  2. Use findDataPoints to find out the number of HitData items selected. If the number is 0, the area is selected by dragging. If the number is 1, the area is selected by clicking the mouse, this avoids scaling Chart by clicking and selecting a single HitData.
  3. To ensure the practicability of selecting a single HitData generation curve for the region, the generated curve also includes two HitData near the HitData.

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.