D3 Heat map legend axis

Hi, I can not add a legend axis, any help appreciated, thanks.

Looks like you have most of it already. Just finish converting from the graph dimensions to the legend dimensions on your legend scale and axis and since your legend color boxes cover the whole legend, you may want to increase the height of the legend SVG to accommodate the axis as well.

The only problem I had was with the legend construction; I found that I needed to create the legend SVG and append the color boxes to it in two separate steps to get your code to draw the axis.

Other than this, it’s just like the x-axis in the graph as far as dimensions and except for the scale type.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.