B4J Question [Solved] xChartLite values lagging mouse pointer

Chris2

Active Member
Licensed User
With bar charts on the xChartLite library, I'm finding that sometimes the values shown are lagging where the mouse pointer actually is.
For example, in this screen shot:
xChartValuesLagging.png

the values shown are for where the vertical red line is drawn, but the mouse pointer is actually a few bars to the left of this.

The problem is only really noticeable with a relatively high number of bars (>50 or so). The amount of 'lag' seems to correspond to the distance between the y-axis and the position of the first bar.
So for example, you'll see it happen if you change the loop in the xChartLiteDemo StackedBarChart sub to:
B4X:
Private Sub CreateStackedBarData
    ......
    ' add the items
    For i = 0 To 100
        StackedBarChart1.AddBarMultiplePoint(2005 + i, Array As Double(Rnd(0, 1000), Rnd(0, 1000), Rnd(0, 1000)))
    Next
    
   ......
End Sub
It occurs on all the types of bar chart, but not line charts.

Is there anything that can be done to correct this?
 

Chris2

Active Member
Licensed User
Solved by @klaus...

Thank you (again)!
 
Upvote 0

Chris2

Active Member
Licensed User
Sorry for not having answered here.
I was sure I did, but I probably missed it.
No worries. I spotted your fix in the xChartLite library thread.

I thought it sensible to add a 'solved' post here for future reference, but wasn't sure about the etiquette of marking my own post as the solution when it wasn't me that solved it :).
 
Upvote 0
Top