Class AnnounceNewData

  • All Implemented Interfaces:
    Serializable, OptionDataListener, org.zkoss.json.JSONAware

    public class AnnounceNewData
    extends Optionable
    An options for announcing new data to screen reader users. Useful for dynamic data applications and drilldown.

    Keep in mind that frequent announcements will not be useful to users, as they won't have time to explore the new data. For these applications, consider making snapshots of the data accessible, and do the announcements in batches.

    Since:
    10.2.1.0
    Author:
    jumperchen
    See Also:
    Serialized Form
    • Constructor Detail

      • AnnounceNewData

        public AnnounceNewData()
    • Method Detail

      • getAnnouncementFormatter

        public org.zkoss.json.JavaScriptValue getAnnouncementFormatter()
        Returns the optional formatter callback for the announcement

        Default: null

      • setAnnouncementFormatter

        public void setAnnouncementFormatter​(org.zkoss.json.JavaScriptValue announcementFormatter)
        Sets the optional formatter callback for the announcement. Receives up to three arguments. The first argument is always an array of all series that received updates. If an announcement is already queued, the series that received updates for that announcement are also included in this array. The second argument is provided if chart.addSeries was called, and there is a new series. In that case, this argument is a reference to the new series. The third argument, similarly, is provided if series.addPoint was called, and there is a new point. In that case, this argument is a reference to the new point.

        The function should return a string with the text to announce to the user. Return empty string to not announce anything. Return false to use the default announcement format.

        Parameters:
        announcementFormatter -
      • isEnabled

        public boolean isEnabled()
        Returns whether to enable announcing new data to screen reader users.

        Default: false

      • setEnabled

        public void setEnabled​(boolean enabled)
        Sets whether to enable announcing new data to screen reader users.

        Default: false

      • isInterruptUser

        public boolean isInterruptUser()
        Returns whether or not the announcements should interrupt the screen reader. If not enabled, the user will be notified once idle. It is recommended not to enable this setting unless there is a specific reason to do so.

        Default: false

      • setInterruptUser

        public void setInterruptUser​(boolean interruptUser)
        Sets whether or not the announcements should interrupt the screen reader. If not enabled, the user will be notified once idle. It is recommended not to enable this setting unless there is a specific reason to do so.

        Default: false

      • getMinAnnounceInterval

        public Number getMinAnnounceInterval()
        Returns the minimum interval between announcements in milliseconds. If new data arrives before this amount of time has passed, it is queued for announcement. If another new data event happens while an announcement is queued, the queued announcement is dropped, and the latest announcement is queued instead. Set to 0 to allow all announcements, but be warned that frequent announcements are disturbing to users.

        Default: 5000

      • setMinAnnounceInterval

        public void setMinAnnounceInterval​(Number minAnnounceInterval)
        Sets the minimum interval between announcements in milliseconds. If new data arrives before this amount of time has passed, it is queued for announcement. If another new data event happens while an announcement is queued, the queued announcement is dropped, and the latest announcement is queued instead. Set to 0 to allow all announcements, but be warned that frequent announcements are disturbing to users.

        Default: 5000