Center values on 100% stacked bar chart (percentbar)

(3 posts) (2 voices)
  1. Avatar, Member

    Good day.

    I need help to center and format the values displayed on the 100% stacked bar chart (percentbar).

    Detailed explanation:
    - On the graph you can see all the percentages are displayed. At present the %'s are right aligned within their respective bars.
    - I would like to add formatting to these "values/labels". For example; center align them within their bars and make the text white.

    Is this possible?

    (I have tried to format the specific values column (see commented out line of code) but then it breaks the display on the graph)

    Code to reproduce graph:

    select 'dbr.chart', 'percentbar', '100% stacked bar chart', 400, 200 ;
    select 'dbr.chart.options', 'legend.position', 'bottom';
    select 'dbr.chart.color','#3462be', '#4d689f', '#99a9c8' , '#0075b0', '#66add0' ;
    select 'dbr.chart.options', 'scale', 0 , 100, 20;
    select 'dbr.chart.options', 'label.wrap', 40;
    select 'dbr.chart.options', 'legend_font_size', 8.5;
    select 'dbr.chart.options', 'axis_font_size', 9;
    select 'dbr.chart.options', 'showvalues' , 1;
    select 'dbr.resultclass', 'no_tooltip';
    #select 'dbr.colstyle', 3, '[text-align:left;color:white;]';

    select 'a', 'one', 10
    UNION ALL
    select 'a', 'two', 20
    UNION ALL
    select 'a', 'three', 15
    UNION ALL
    select 'b', 'one', 30
    UNION ALL
    select 'b', 'two', 10
    UNION ALL
    select 'b', 'three', 5;

    Thanks in advance,
    Avatar

  2. myDBR Team, Key Master

    If you run the updater you can use:

    select 'dbr.chart.options', 'label_font_color', '0xFFFFFF';
    select 'dbr.chart.options', 'label.align', 'center';

    --
    myDBR Team

  3. Avatar, Member

    It works perfectly!

    Great support, thanks guys.


Reply

You must log in to post.