* @param <H>
* @param handler the function to call when the event is fired
* @return the new handler reference. Can be used for removing by calling {@link #removeHandler(HandlerRef)}.
*/
protected final <H extends EventHandler> HandlerRef addHandler(H handler) {
HandlerRef handlerRef = chartObject.addListener(handler.getEventName(), handler);
eventMap.put(handlerRef, handler);
return handlerRef;
}