amcharts5
amcharts5 copied to clipboard
Incorrect value in legendLabelText placeholder
I've modified the Step Line Chart example to include a legend that updates its text to the Y value currently pointed by the cursor:
The problem is that the value is correct only in the first half of the step, while in the second half it updates already to the next value.
Both of your screenshots show same value in series tooltip and legend. Same thing in the jsFiddle.
What am I missing?
The problem is that in both screenshots the cursor is on the same "step".
The expected behavior is that the value (in tooltip and legend both) is 0.019 in both screenshots.
I did not notice that the same problem is on the tooltip too, my guess at this point is that the bug is not on the legend but rather on the cursor or placeholder.
This is how ValueAxis works, it shows tooltip of the nearest data point. To solve your problem, you should change your xAxis type to DateAxis and then set xAxis for your cursor. This way the line will snap to the position where the tooltip is: https://codepen.io/team/amcharts/pen/rNdJWzG
I don't see a way to solve this with ValueAxis.
Thanks, let's see what the authors decide to do about this
This issue is stale because it has been open 30 days with no activity. It will be closed in 5 days unless a new comment is added.