2 Replies Latest reply: Jun 5, 2012 11:11 PM by 786777 RSS

    can a chart be dynamically refreshed?

    B.Delmée
      I am using Apex 4.1, and it seems binding a refresh action with a chart region as target is not supported. The event to which I am trying to react is a selection change in a drop-down box. The binding works alright e.g for displaying an alert, but trying to refresh the region has no effect.
        • 1. Re: can a chart be dynamically refreshed?
          B.Delmée
          I sorta figured it out from this blog post

          First one needs to edit the chart region source and add the following at the end:
          <script type="text/javascript">
          function refresh_chart() {
            var chartName = '#CHART_NAME#'.substring(1);
            apex_RefreshFlashChart(&APP_PAGE_ID., chartName, 'en');
          }
          </script>
          Then add the following javascript function definition to your page header:
          function change_handler(item) {
            var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=Do Nothing',0);
            get.add(item.id, item.value);
            var ret = get.get();
            refresh_chart();
          }
          finally, set your item "Page Action when Value Changed" to "none", and its "HTML Form Element Attributes" to
          onChange="javascript:change_handler(this);"
          <b>but</b> I was hoping for a simpler, more direct support from dynamic actions; am I missing something ?
          • 2. Re: can a chart be dynamically refreshed?
            786777
            Cool! It just works as expected.

            Thanks,
            Jichao Li