# Using Zoom plugin

const config = {
  type: 'treemap',
  data: {
    datasets: [
      {
        label: 'My First dataset',
        tree: Utils.numbers(NUMBER_CFG),
        borderWidth: 0,
        backgroundColor: (ctx) => colorFromRaw(ctx),
        labels: {
          display: true,
          formatter: (ctx) => ctx.raw.v.toFixed(2),
          font: {
            size: 16
          },
          overflow: 'fit'
        }
      }
    ],
  },
  options: {
    plugins: {
      zoom: {
        zoom: {
          wheel: {
            enabled: true,
          }
        },
        pan: {
          enabled: true,
        }
      }
    }
  }
};
Last Updated: 11/13/2023, 6:13:46 PM