简体   繁体   English

MPAndroidChart-水平自定义动态坐标突出显示

[英]MPAndroidChart - horizontal custom dynamic coordinate highlight

I'm using a MPAndroidChart for graphing. 我正在使用MPAndroidChart进行绘图。 My question is related to highlights. 我的问题与重点相关。 There are two types of highlights: 突出显示有两种类型:

  1. vertical highlight 垂直高光
  2. horizontal highlight 水平高光

In my use case I'm satisfied with the behavior of the vertical highlight but I'd like to be able to customize the behavior of horizontal highlight. 在我的用例中,我对垂直高光的行为感到满意,但我希望能够自定义水平高光的行为。 Now the vertical highlight is set to the middle of the candle body in case of candlestick chart and horizontal is set somewhere else - static. 现在,在烛台图表的情况下,垂直高光设置为蜡烛主体的中间,水平设置为其他位置-静态。

I'd like to customize the horizontal highlight to be on the position of the finger. 我想自定义水平高光显示在手指的位置。 So if I put my finger on one of the CandleEntry the horizontal highlight would go up and down by the actual position of my finger (maybe onDrag event). 因此,如果我将手指放在CandleEntry之一上,则水平高光将根据手指的实际位置上下移动(可能是onDrag事件)。

My question is how to achieve this: 我的问题是如何实现这一目标:

  1. is there some built-in method for this behavior 是否有一些内置方法可以解决此问题
  2. or do I have to implement it on my own? 还是我必须自己实施? If so, then can you give me advice or some hint how to achieve this. 如果是这样,那么您可以给我建议或提示如何实现这一目标。

I'd appreciate any idea how to do that. 我将不胜感激如何做到这一点。

I never tried but it may be done by using limit line. 我从未尝试过,但是可以通过使用极限线来完成。 Give it a try ! 试试看 !

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM