Heat legend with scale

This demo shows, how we can add a scale to a Heat Legend by pushing regular ValueAxis into it.

Code

let heatAxis = heatLegend.children.push(am5xy.ValueAxis.new(root, {
  strictMinMax: true,
  renderer: am5xy.AxisRendererX.new(root, {
    inversed: true
  })
}));

heatAxis.adapters.add("min", function() {
  return series.getPrivate("valueLow");
});

heatAxis.adapters.add("max", function() {
  return series.getPrivate("valueHigh")
});
var heatAxis = heatLegend.children.push(am5xy.ValueAxis.new(root, {
  strictMinMax: true,
  renderer: am5xy.AxisRendererX.new(root, {
    inversed: true
  })
}));

heatAxis.adapters.add("min", function() {
  return series.getPrivate("valueLow");
});

heatAxis.adapters.add("max", function() {
  return series.getPrivate("valueHigh")
});

Demo

See the Pen Heat legend with scale by amCharts team (@amcharts) on CodePen.

Posted in Uncategorized