Skip to Content
avatar image
Former Member

Setting Pie Chart color dynamically

Hi All,

I am using FPM_CHART_UIBB component to design a pie chart with 3 different colors. I used the color palette settings under the "plot area" section of "general settings", where I have provided fixed color in the format ["#FF0000","#FFFF00","#00FF00"]. This works fine. However my requirement is to render the chart color dynamically where the color code will be decided at run-time instead of fixing them during design time. How can I achieve this.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 19 at 01:04 PM

    You can manipulate the chart configuration dynamically at run time via the settings object IO_CHART_SETTINGS which is passed ti the chart's feeder GET_DATA method.

    Somethin like

       io_settings->SET_CHART_SETTING( iv_property_name = 'plotArea.colorPalette' iv_value = '["#FF0000","#FFFF00","#00FF00"]' ).

    should do the trick.

    Best regards,

    Christian

    Add comment
    10|10000 characters needed characters exceeded