0

I have a linechart and I am reading the values of lines with moousemovement event but I can only read only one line value with crossline. My mouse is on purple line right now. I want to read all values on crossline which intersects the lines which is stated with red circles. My code looks like :

    if(chartEntity instanceof XYItemEntity){
      
       double chartX = event.getTrigger().getX();
       double chartY = event.getTrigger().getY();
        
       XYItemEntity xyItemEntity = (XYItemEntity) chartEntity
       XYDataset xyDataSet = xyItemEntity.getDataSet();
       double xValue = xyDataSet.getXValue(xyItemEntity.getSeriresIndex(), xyItemEntity.getItem());
       double yValue = xyDataSet.getYValue(xyItemEntity.getSeriresIndex(), xyItemEntity.getItem());
       lblShowMousePosition.setText(String.format("X = %.2f | Y = %.2f", xValue, yValue));```
[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/vvL4a.png
shnnens
  • 11
  • 2
  • Please [edit] your question to include a [mre] that exhibits the problem you describe. – trashgod Mar 10 '22 at 13:54
  • Possible duplicate of [_Display mouse coordinates near mouse as hints on mouse move_](https://stackoverflow.com/a/21180275/230513). – trashgod Mar 11 '22 at 17:04

0 Answers0