# 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/25/2024, 4:10:50 PM