Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Values not showing when I hover over the graph

Hi, I’m facing a problem where the value of the graph is not shown anymore when I hover over it. I used to be able to hover and see the values, but its not working now for some reason. (The examples on plotly website work fine)

Initially I thought it could be due to having {displayModeBar: false} when I plot my graph:
Plotly.newPlot(‘myDiv’, data, layout, {displayModeBar: false});
but even the display bar does not show anymore. Anyone knows why this is happening?

Can you share a reproducible example?

Here’s an example:
I’m using Django, so {{ chart_xaxis }} and {{ chart_yaxis }} provides me with the data I need.

> function chartPlotly() {
> 	var dates = [], preData = [], data = [], arr = [], chartData = [];
> 	dates = "{{ chart_xaxis }}".split(',');
> 	preData = "{{ chart_yaxis }}".split('||');
> 	for(var i=0 ; i<preData.length ; i++) {
> 		arr.push(preData[i].split('|')[0]);
> 		data.push(preData[i].split('|')[1].split(','));
> 	}

> 	for(var i = 0; i < arr.length; i++) {
> 		chartData.push( {
> 			x: dates,
> 			y: data[i],
> 			mode: 'lines+markers',
> 			name: arr[i],
> 			line: {shape: 'spline'},
> 			type: 'scatter',
> 			connectgaps: true
> 		});
> 	}

> 	var layout = {
> 	  xaxis: {
> 	    title: 'x',
> 	    showgrid: false,
> 	    zeroline: false
> 	  },
> 	  yaxis: {
> 	    showline: false
> 	  },
> 	};

> 	Plotly.newPlot('myDiv', chartData, layout, {displayModeBar: false});
> }

Can you share a few columns of your data?