Display legend in a stacked bar chart using ngx-echarts in Angular

122 views Asked by At

I have a stacked bar chart which contains different categories of data based on month. I'm displaying it as a stacked bar chart, but I also need to display the legend to go along with the data so that each color is understandable.

The chart looks like this.

I have tried defining the legend in different ways, for example like this:

legend: {
        data: this.categoryArray,
        orient: 'vertical',
        right: 10,
        show: true
      }

where categoryArray is a simple string array containing all the different categories of data.

Despite this, my chart appears without a legend. Does anyone know how I can actually display the legend along with the chart itself? Thanks.

0

There are 0 answers