ChartDirector extra fields in chart label?

(7 posts) (2 voices)
  1. duane, Member


    I'm trying to provide a more descriptive label for a bar chart using ChartDirector parameter substitution. I have a query that returns

    select label, value AS 'p[percent]', field1 AS 'F1[field1], field2 AS 'F2[field2] from table;

    which displays fine in the barchart, but when I try and include field1 and field2 in the bar chart label I can't get it to work. I am using

    select 'dbr.colstyle', 'percent', '{label}: {value|0}% ({dsField0|0} of {value|0})';

    (and various other combinations) it displays the percentage fine, but not the extra field values.

    to try and get a label like x% (y of z)

    Is what I am trying possible in MyDBR's ChartDirector implementation and if so, how?


  2. myDBR Team, Key Master

    could you give and example with sample data what the label "x% (y of z)" would mean in bar chart? Percentage of what? What are the y and z in your example?

    myDBR Team

  3. duane, Member

    Sure - the label might say "21% (11 of 50)" for one bar and might say 28% (7 of 25) for another bar.

    The idea is to give people both the relative proportion of a category population e.g. 28% (each bar is a different category) and the absolute number (e.g. 7) that makes that of the population size (e.g. 25)

  4. myDBR Team, Key Master

    could you show your chart data so we see where the actual numbers come from? If you have label saying 21% (11 of 50), then 11/50 = 22%, but where do you get the 11 and the 50? And if the next bar would say "28% (7 of 25) ", where do you get the 7 and the 25?

    The bar chart data has a form of:

    select label, value

    myDBR Team

  5. duane, Member

    G % __ T__ I__
    A 6% 293 19
    B 11% 247 27
    C 15% 52 8
    D 11% 38 4

    Where G=group name, % = % of that group, T=Total group member, I= included group members

    Does that help? (the data is real, the labels have been changed to generalise it). This is from survey results where T is the population surveyed and I is the number of completed surveys.

  6. myDBR Team, Key Master

    you cannot use ChartDirector parameter substitution as the extra columns are never passed to ChartDirector, just the first two. You should instead use myDBR's formatting.

    Unfortunately the label formatting is, for now, only available for dbf.colstyle which does not apply at this time as each bar would need a individual label. Label support for dbr.cellstyle would be required.

    What you can do instead, is to use tooltip to show the extra information. User would then see the details with mouse hovering.

    The tooltip formatting would be:

    select 'dbr.chart.options', 'tooltip', '[percent]% ([cnt]/[total])';

    We can take a look if dbr.cellstyle could support label formatting as well.
    myDBR Team

  7. duane, Member

    OK - thanks for clarifying!


You must log in to post.