reactjsnext.jsmaterial-uimui-xmui-x-charts

Why is my MUI X Line chart only showing the last value when hovering on any of the charts marker points


I'm utilizing MUI x charts to display data visually. The chart visualization itself is functioning correctly. However, I'm encountering an issue where only the latest marker point is being displayed when hovering.

enter image description here

Does anyone know why the data is showed perfect but only the latest line is selected when hovering?

I have create an example below:

MUI x chart example


Solution

  • You need to the reverse order of data array like this:

    data: [// your items].reverse()

    CodeSandbox

    For some reason, it is expecting the datetime in decreasing order.