Highcharts - I can't display legend of datasets

64 Views Asked by At

I'd like to show datasets on the bottom of charts but the only 'series 1' is displayed that I don't want.

How can I display the datasets of 'VIOO: 16.7%', 'MRNA: 9.9%', 'VO: 9.4%', etc on the bottom of the chart?

const highChartDataset =
    this.portfolioModel.map((x) => {
       return {
         name: x.symbol,
         value: toNumber((x.asset * 100 / sumAsset).toFixed(1)),
        }
      })

    this.highChartOptions = {
      chart: {
        type: 'treemap',
        backgroundColor: '#121212'
      },
      title: { text: '' },
      legend: {
        enabled: true,
        layout: 'vertical',
      },
      series: [{
        data: highChartDataset,
        type: "treemap",
        layoutAlgorithm: 'squarified',
        alternateStartingDirection: true,
        showInLegend: true,
        dataLabels: {
          enabled: true,
          style: {
            color: '#ffffff',
          },
          format: '{point.name}: {point.value}%'
        }
      }]
    }

screenshot

0

There are 0 best solutions below