shahab kamali
shahab kamali

Reputation: 341

how to set label for bar stack to echarts

I am using echarts. this is my chart:

echarts

I have several xaxix this picture shows one xaxis data and two bar(stack). info:stack put data on top of each other in one xaxis data. so in this case I have Two bar

my question is: how can I set label for each stack(not xaxis label I am showing with red) there is an option for this purpose?

Upvotes: 3

Views: 6145

Answers (2)

Conor
Conor

Reputation: 461

This is the correct way to to it.

xAxis : [ { type : 'category', data : ["Name 1","Name 2"] } ],

Upvotes: 0

Saran
Saran

Reputation: 1575

I think this is the way to show label in echarts

 series : [
        {
            name:'Name',
            type:'bar',
            stack: 'StackName',
            itemStyle : { normal: {label : {show: true, position: 'inside*'}}},
            data:[sample data]
        }

If you show your code it would be more helpful to figuring out.

Upvotes: 1

Related Questions