0%-values in a pie-chart with percentages

(10 posts) (2 voices)

Tags:

No tags yet.

  1. JimTer, Member

    How can i suppress the 0%-values in a pie-chart with percentages?

    They are not relevant to me in what a want.

    Thank you for reading this en trying to help me!

    Jim

  2. myDBR Team, Key Master

    An example code will help us understand what 0%'s you are referring to.

    --
    myDBR Team

  3. JimTer, Member

    An example.
    In a piechart there are e.g. ten possible values.
    But only two values are present.

    So i see a circle with two halves, with 50%.
    But i see also eight times arrows with the non-present-value and the information 0%.
    I want to suppress this information.

    I do not want to throw the non-present-values out of the origin-table, because i want to see the parts in the right color.

  4. myDBR Team, Key Master

    No need to keep unnecessary information in the chart. Just use chart option label_color to set the color of the pie slice.

    --
    myDBR Team

  5. JimTer, Member

    Can i make the colors in the pie-chart conditionary?

    E.g.
    If the value is 0 then use color '....'
    If the value is 3 then use color '....'

    Thanx in advance.

  6. myDBR Team, Key Master

    The colors are fully customizable. You can put any logic there.

    --
    myDBR Team

  7. JimTer, Member

    Could you please give me a hint how to do "If the value is 0 then use color '....'"?

  8. myDBR Team, Key Master

    You've got two different ways of defining the color. First is the dbr.chart.color which defines the color based on the order of appearance. You could define your color scheme by saying:

    select 'dbr.color', f_define_color_by_value( value )
    from mydata
    order by mysortingorder;

    In the example above you would define function which will turn the value to the color. You can do it without a function, but using a function will give you cleaner code.

    The second way of defining colors is based on the label. You can say:

    select 'dbr.chart.options', 'label_color' , 'Europe', '00C322';

    which will set green color to 'Europe' data.

    --
    myDBR Team

  9. JimTer, Member

    Im sorry, i've tried it, but did not succeed.

    First i tried:

    select 'dbr.chart.color', 'FF0000', 'D60000', 'FF5252', 'FF8000', 'FF9E3D','FFC78F', 'FFFF8F', 'C7FF8F', '8FFF8F' ;

    These are the colors when all values (-4,-3,-3,-2,-1,0,1,2,3,4) occur

    But not all these values are in my table.
    For example: only -1 and 0.
    And i want to have the corresponding colors.

    Now i used your 'hint'.

    select 'dbr.color', -4, 'FF0000';
    select 'dbr.color', -3, 'D60000';
    select 'dbr.color', -2, 'FF5252';
    select 'dbr.color', -1, 'FF8000';
    select 'dbr.color', 0, 'FF9E3D';
    select 'dbr.color', 1, 'FFFF8F';
    select 'dbr.color', 2, 'C7FF8F';
    select 'dbr.color', 3, '8FFF8F';
    select 'dbr.color', 4, '00A300';

    But that dont work on my pie-chart.

    Also this one did not succeed:

    select 'dbr.chart.color', -4, 'FF0000';
    select 'dbr.chart.color', -3, 'D60000';
    select 'dbr.chart.color', -2, 'FF5252';
    select 'dbr.chart.color', -1, 'FF8000';
    select 'dbr.chart.color', 0, 'FF9E3D';
    select 'dbr.chart.color', 1, 'FFFF8F';
    select 'dbr.chart.color', 2, 'C7FF8F';
    select 'dbr.chart.color', 3, '8FFF8F';
    select 'dbr.chart.color', 4, '00A300';

    Please?

  10. myDBR Team, Key Master

    If you wish to set specific color for a label, use 'label_color' chart option:

    select 'dbr.chart.options', 'label_color', -4, 'FF0000';

    --
    myDBR Team


Reply

You must log in to post.