nikitsky / heatmap_calendar_apex_plugin

Oracle APEX Heatmap calendar plugin
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Is it possible to add blocked out periods? #5

Open LordPaulos opened 10 months ago

LordPaulos commented 10 months ago

Love the heatmap, and I was wondering if in a future version if it were possible to add blocked out periods (eg. I am using in an app where I show volume of work for planning, but I also would love to be able to block out certain periods due to embargoes during those dates)

nikitsky commented 10 months ago

Thank you for your valuable feedback regarding the heatmap component. To incorporate blocked-out periods with a distinct visual, I recommend the following approach:

  1. Modify the data query for blocked periods so that it does not return any regular records.
  2. Ensure that the data query for these blocked periods consistently returns a value that's distinctly identifiable, such as -1.
  3. For a unique color representation of blocked periods, you can configure the valueRange and colorRange attributes. This will allow you to set a different appearance for these specific periods.

Considering the specialized visualization of blocked-out periods, I advise turning off the default legend generated by the plugin. This prevents any potential misunderstandings.

To give you a hands-on example, I've made updates to the demo app.

In my implementation, I use a value of -1 for blocked periods. Here's the JavaScript code for initializing the plugin:

function ( pOptions) {
    pOptions.colorRange=["red", "white", "green"];
    pOptions.valueRange=[-1,0,10];
    return pOptions;
  }

I hope you find this solution beneficial!

LordPaulos commented 10 months ago

Thank you - a very elegant solution.

One last comment, is it possible to have this display a Financial Year range, rather than a calendar year range? (for example, in Australia the financial year runs from 1 July to 30 June. So FY24 would be 1 July 2023 to 30 June 2024, FY25 is 1 July 2024 to 30 June 2025, etc)