ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Stcked bar queston
Posted by Randy on Dec-07-2010 06:16
Attachments:
is it possible to display the percentage of total of one value on a stacked bar graph?

on the attached image - I would like to display the percentage of blue to blue + red...

so on the date 11/22 it would be somthing like (21 / (21+42) ) * 100 = 33% or so...

can this be done?
StackedBar.png

  Re: Stcked bar queston
Posted by Peter Kwan on Dec-08-2010 00:30
Hi Randy,

Yes. You can display anything you like on the stacked bar chart. The exact code depends on where you want to display them.

The easiest case is to display the labels on the blue bar segment itself. However, for your case, the blue bar segments seem too small and there may be insufficient space for the labels. Anyway, you may try something like (in VB/VBScript):

'display percentage
Call layer.setDataLabelFormat("{percent}%")
Call layer.setDataLabelStyle("arialbd.ttf", 8, &Hffffff).setAlignment(cd.Bottom)
Call layer.setMinLabelSize(0)   'force label to display even if there is insufficient space

If you need further help, please kindly clarify where would you like to display the labels.

Regards
Peter Kwan