Incorrect tooltip information for stacked bar chart in Grafana

  • What Grafana version and what operating system are you using?
    Grafanva v9.3.1, Ubuntu 18

What are you trying to achieve?

I am creating a stacked bar chart in Grafana to display data about users added by year from a JSON data source.

How are you trying to achieve it?

I have successfully generated a stacked bar chart using the JSON data source, and it visually represents the data accurately. The data is well-aligned, and the Grafana timezone setting matches the timezone of the data in my source. I have also set the tooltip mode to ‘single’ to show the data for the individual bar series.

What happened?

When I hover over a specific bar in the chart, the tooltip seems to display information for the adjacent series instead of the one I’m pointing at. This behavior seems to be consistent across all bars in the chart.

What did you expect to happen?

I expected the tooltip to display the correct data for the bar that I’m hovering over in the chart. The tooltip data should match the visual representation of the data in the chart.

Could this issue be related to how Grafana processes data for the tooltip in a stacked bar chart? Is there a specific way I need to format my data for the tooltips to work correctly? Any suggestions or insights would be greatly appreciated.

In the attached screenshot, you’ll see that my mouse is pointing at the bar for “2021”, but the tooltip is showing info for “2022”.

This is an example of my JSON data source:

	"chart4": [
		{
			"2019": 9,
			"2020": 7,
			"2021": 4,
			"2022": 7,
			"2023": 2,
			"division": "Div 0"
		},
		{
			"2019": 1,
			"2020": 1,
			"2021": 2,
			"2022": 0,
			"2023": 0,
			"division": "Div 2"
		},
		{
			"2019": 1,
			"2020": 5,
			"2021": 1,
			"2022": 4,
			"2023": 1,
			"division": "Div 3"
		},
		{
			"2019": 0,
			"2020": 0,
			"2021": 4,
			"2022": 4,
			"2023": 1,
			"division": "Div 4"
		},
		{
			"2019": 5,
			"2020": 19,
			"2021": 16,
			"2022": 9,
			"2023": 0,
			"division": "Div 6"
		},
		{
			"2019": 136,
			"2020": 46,
			"2021": 87,
			"2022": 87,
			"2023": 21,
			"division": "Div 7"
		},
		{
			"2019": 4,
			"2020": 4,
			"2021": 11,
			"2022": 9,
			"2023": 0,
			"division": "Div 8"
		},
		{
			"2019": 10,
			"2020": 3,
			"2021": 5,
			"2022": 9,
			"2023": 2,
			"division": "Div 9"
		},
		{
			"2019": 1,
			"2020": 4,
			"2021": 4,
			"2022": 2,
			"2023": 0,
			"division": "Div 10"
		},
		{
			"2019": 6,
			"2020": 4,
			"2021": 2,
			"2022": 1,
			"2023": 0,
			"division": "Div 11"
		},
		{
			"2019": 1,
			"2020": 0,
			"2021": 3,
			"2022": 0,
			"2023": 0,
			"division": "Div 16"
		}
	],