Package org.zkoss.chart
Class AnnounceNewData
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.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
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description AnnounceNewData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.zkoss.json.JavaScriptValue
getAnnouncementFormatter()
Returns the optional formatter callback for the announcementNumber
getMinAnnounceInterval()
Returns the minimum interval between announcements in milliseconds.boolean
isEnabled()
Returns whether to enable announcing new data to screen reader users.boolean
isInterruptUser()
Returns whether or not the announcements should interrupt the screen reader.void
setAnnouncementFormatter(org.zkoss.json.JavaScriptValue announcementFormatter)
Sets the optional formatter callback for the announcement.void
setEnabled(boolean enabled)
Sets whether to enable announcing new data to screen reader users.void
setInterruptUser(boolean interruptUser)
Sets whether or not the announcements should interrupt the screen reader.void
setMinAnnounceInterval(Number minAnnounceInterval)
Sets the minimum interval between announcements in milliseconds.-
Methods inherited from class org.zkoss.chart.Optionable
addExtraAttr, addOptionDataListener, clearOptonDataListener, clone, containsKey, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getAttr, getAttr, getClientState, getExtraAttr, merge, onChange, removeExtraAttr, removeKey, removeOptionDataListener, setAttr, setAttr, setAttr, setAttr, toJSONString, toString
-
-
-
-
Method Detail
-
getAnnouncementFormatter
public org.zkoss.json.JavaScriptValue getAnnouncementFormatter()
Returns the optional formatter callback for the announcementDefault:
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
-
-