+ Start a Discussion
Thomas Reinman 16Thomas Reinman 16 

How to define Legend with Apex:barseries (stacked = true)

I've got an apex:chart that's rendering some data from a custom controller. 

I'm using an apex:barseries to display the data, and I've chosen to select stacked="true", which stacks two integer values onto the same column. 

The problem is, when you define the fields for that axis (in this case the right y axis), you give the axis a Title (i.e., Number of Customers), but when you display the Legend, there is no way to dicipher what each grouping in the stacked column represents. The Legend will just display the Title of the axis for each unique grouping. 

Does anyone know how to indicate a unique value for each group within the Legend? Thanks ~

User-added image
Best Answer chosen by Thomas Reinman 16
Raj VakatiRaj Vakati
I dnt think so you have that option ..  

Can you try this?  

Dnt set the  apex:legend  and use the custom text to display the legend using the HTML ( p and div and align to center ) 
 

All Answers

Raj VakatiRaj Vakati
I dnt think so you have that option ..  

Can you try this?  

Dnt set the  apex:legend  and use the custom text to display the legend using the HTML ( p and div and align to center ) 
 
This was selected as the best answer
Thomas Reinman 16Thomas Reinman 16
Thanks Raj -- that's a clever workaround. I ended up switching the values for the bar / lines graphs and took advantage of the circle/cross markers that the line graphs have to offer.
User-added image
Raj VakatiRaj Vakati
Cool .. Close thread