You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2019/11/20 08:03:52 UTC

[GitHub] [incubator-echarts] Ovilia opened a new pull request #11684: WIP(axisPointer): snapping logic WIP.

Ovilia opened a new pull request #11684: WIP(axisPointer): snapping logic WIP.
URL: https://github.com/apache/incubator-echarts/pull/11684
 
 
   ```
   /**
   * If both x and y axes are snapping and one and only one of them is
   * of category type, then the category axis is used as primary
   * snapping, otherwise the baseAxis is used as primary snapping.
   * The snapped value of the other axis is calculated from it.
   *
   *  4 |                 *
   *  3 |       *
   *  2 |            *
   *  1 |  *     +
   *    ---------------------
   *       a    b    c    d
   *
   * In the above example, the x axis is in category type, and y axis
   *     value.
   * The *'s are data items, + is the mouse position.
   *
   * If both x and y axes are using snapping, then:
   * 1. x axis is used as primary snapping axis because it's the only
   *     category axis.
   * 2. The nearest x value to the mouse is 'b', so 'b' is used as
   *     snapped x value.
   * 3. The corresponding y value of 'b' is 3, so 3 is used as snapped y
   *     value.
   * 4. So the axisPointer should be at ('b', 3).
   *
   * If only x is snapping, then the axisPointer should be at ('b', 1).
   * If only y is snapping, then the axisPointer should be at the
   *     position of +.
   */
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org