Bring Drag & Drop to Dash with Dashboard Engine. 💫 Learn how at our next webinar!

Fixed size cell of ployly heatmap?

Currently what happening is width of cell depends on the data for x-axis. If data is very large then cells become very small.

I want width of the plotly.js heatmap cell to be of fixed size. If data is very large then a scroll should come instead cells size decreasing.

Replace the js by below code, cells size will decrease.

var data = [
{
z: [[1, 20, 30, 50, 1, 1, 20, 30, 50, 1], [20, 1, 60, 80, 30, 20, 1, 60, 80, 30], [30, 60, 1, -10, 20, 30, 60, 1, -10, 20]],
x: [‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Monday1’, ‘Tuesday1’, ‘Wednesday1’, ‘Thursday1’, ‘Friday1’],
y: [‘Morning’, ‘Afternoon’, ‘Evening’],
type: ‘heatmap’
}
];

Plotly.newPlot(‘myDiv’, data);

I tried going through the api but no help.

1 Like

I want width of the plotly.js heatmap cell to be of fixed size

Yeah, that’s no way to do that at the moment. You’ll have to (manually) increase layout.height and layout.width to increase your heatmap cells’ size.

Etienne, thank you very much for the help.

Is there any plan to have this feature? Fixed sized cells are important if we want to plot an occupancy grid.

1 Like