ChartBase.js revision d79066bfa31eec6909a20ccabb5227cc1e1ea2d0
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * The ChartBase class is an abstract class used to create charts.
a75ebc38c1de401b679953a9b87bd323f0f48d02Tripp * @module charts
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @class ChartBase
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @constructor
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTrippfunction ChartBase() {}
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * Reference to the default tooltip available for the chart.
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * <p>Contains the following properties:</p>
87a49173dbc22a145cb87e605cca83fd42524377Tripp * <dt>node</dt><dd>Reference to the actual dom node</dd>
87a49173dbc22a145cb87e605cca83fd42524377Tripp * <dt>showEvent</dt><dd>Event that should trigger the tooltip</dd>
87a49173dbc22a145cb87e605cca83fd42524377Tripp * <dt>hideEvent</dt><dd>Event that should trigger the removal of a tooltip (can be an event or an array of events)</dd>
87a49173dbc22a145cb87e605cca83fd42524377Tripp * <dt>styles</dt><dd>A hash of style properties that will be applied to the tooltip node</dd>
87a49173dbc22a145cb87e605cca83fd42524377Tripp * <dt>show</dt><dd>Indicates whether or not to show the tooltip</dd>
87a49173dbc22a145cb87e605cca83fd42524377Tripp * <dt>markerEventHandler</dt><dd>Displays and hides tooltip based on marker events</dd>
87a49173dbc22a145cb87e605cca83fd42524377Tripp * <dt>planarEventHandler</dt><dd>Displays and hides tooltip based on planar events</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>markerLabelFunction</dt><dd>Reference to the function used to format a marker event triggered tooltip's text. The method contains
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * the following arguments:
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>categoryItem</dt><dd>An object containing the following:
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>axis</dt><dd>The axis to which the category is bound.</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided).</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>key</dt><dd>The key of the category.</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>value</dt><dd>The value of the category.</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>valueItem</dt><dd>An object containing the following:
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>key</dt><dd>The key for the series.</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>value</dt><dd>The value for the series item.</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>itemIndex</dt><dd>The index of the item within the series.</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>series</dt><dd> The `CartesianSeries` instance of the item.</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp * will also need to override the tooltip's `setTextFunction` method to accept an html string.
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>planarLabelFunction</dt><dd>Reference to the function used to format a planar event triggered tooltip's text
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>categoryAxis</dt><dd> `CategoryAxis` Reference to the categoryAxis of the chart.
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>valueItems</dt><dd>Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>axis</dt><dd>The value axis of the series.</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>key</dt><dd>The key for the series.</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>value</dt><dd>The value for the series item.</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>index</dt><dd>The index of the item within its series.</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>seriesArray</dt><dd>Array of series instances for each value item.</dd>
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp * will also need to override the tooltip's `setTextFunction` method to accept an html string.
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp * <dt>setTextFunction</dt><dd>Method that writes content returned from `planarLabelFunction` or `markerLabelFunction` into the the tooltip node.
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp * has the following signature:
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp * <dt>label</dt><dd>The `HTMLElement` that the content is to be added.</dd>
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp * <dt>val</dt><dd>The content to be rendered into tooltip. This can be a `String` or `HTMLElement`. If an HTML string is used, it will be rendered as a
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp * string.</dd>
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @attribute tooltip
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @type Object
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * The key value used for the chart's category axis.
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @attribute categoryKey
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @type String
f69d245bb21be88752420e834a6b6be37e9b525fTripp * @default category
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * Indicates the type of axis to use for the category axis.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>category</dt><dd>Specifies a `CategoryAxis`.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>time</dt><dd>Specifies a `TimeAxis</dd>
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @attribute categoryType
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @type String
f69d245bb21be88752420e834a6b6be37e9b525fTripp * @default category
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * Indicates the the type of interactions that will fire events.
87a49173dbc22a145cb87e605cca83fd42524377Tripp * <dt>marker</dt><dd>Events will be broadcasted when the mouse interacts with individual markers.</dd>
87a49173dbc22a145cb87e605cca83fd42524377Tripp * <dt>planar</dt><dd>Events will be broadcasted when the mouse intersects the plane of any markers on the chart.</dd>
87a49173dbc22a145cb87e605cca83fd42524377Tripp * <dt>none</dt><dd>No events will be broadcasted.</dd>
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @attribute interactionType
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @type String
f69d245bb21be88752420e834a6b6be37e9b525fTripp * @default marker
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp * Data used to generate the chart.
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @attribute dataProvider
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @type Array
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * A collection of keys that map to the series axes. If no keys are set,
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * they will be generated automatically depending on the data structure passed into
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * the chart.
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @attribute seriesKeys
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @type Array
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * Reference to all the axes in the chart.
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @attribute axesCollection
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @type Array
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * Reference to graph instance.
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @attribute graph
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp * @type Graph
14bfa36e35102dbf271dcff98f773a01c75bd503Tripp * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.
14bfa36e35102dbf271dcff98f773a01c75bd503Tripp * @attribute groupMarkers
14bfa36e35102dbf271dcff98f773a01c75bd503Tripp * @type Boolean
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Default value function for the `Graph` attribute.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _getGraph
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @return Graph
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * Returns a series instance by index or key value.
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp * @method getSeries
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @param val
f69d245bb21be88752420e834a6b6be37e9b525fTripp * @return CartesianSeries
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp var series = null,
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Returns an `Axis` instance by key reference. If the axis was explicitly set through the `axes` attribute,
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * the key will be the same as the key used in the `axes` object. For default axes, the key for
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * the category axis is the value of the `categoryKey` (`category`). For the value axis, the default
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * key is `values`.
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp * @method getAxisByKey
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @param {String} val Key reference used to look up the axis.
f69d245bb21be88752420e834a6b6be37e9b525fTripp * @return Axis
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp * Returns the category axis for the chart.
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp * @method getCategoryAxis
f69d245bb21be88752420e834a6b6be37e9b525fTripp * @return Axis
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Default direction of the chart.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @property _direction
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @type String
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @default horizontal
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Storage for the `dataProvider` attribute.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @property _dataProvider
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @type Array
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Setter method for `dataProvider` attribute.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _setDataValues
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Array} val Array to be set as `dataProvider`.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @return Array
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp for(; i < l; ++i)
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Storage for `seriesCollection` attribute.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @property _seriesCollection
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @type Array
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Setter method for `seriesCollection` attribute.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @property _setSeriesCollection
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Array} val Array of either `CartesianSeries` instances or objects containing series attribute key value pairs.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Helper method that returns the axis class that a key references.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _getAxisClass
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {String} t The type of axis.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @return Axis
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp return this._axisClass[t];
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Key value pairs of axis types.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @property _axisClass
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @type Object
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Collection of axes.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @property _axes
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @type Array
f6b84101fdc31536da3815e81c6aa218a5057256Tripp * @method initializer
f6b84101fdc31536da3815e81c6aa218a5057256Tripp this.after("dataProviderChange", this._dataProviderChangeHandler);
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method renderUI
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp //move the position = absolute logic to a class file
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp this.get("boundingBox").setStyle("position", "absolute");
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp this.get("contentBox").setStyle("position", "absolute");
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @property bindUI
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp bindUI: function()
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp this.after("tooltipChange", Y.bind(this._tooltipChangeHandler, this));
8b594f23b40af0ed8368f49ee58370563d1ef0e0Tripp Y.delegate("mouseenter", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);
8b594f23b40af0ed8368f49ee58370563d1ef0e0Tripp Y.delegate("mousedown", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);
8b594f23b40af0ed8368f49ee58370563d1ef0e0Tripp Y.delegate("mouseup", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);
8b594f23b40af0ed8368f49ee58370563d1ef0e0Tripp Y.delegate("mouseleave", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);
8b594f23b40af0ed8368f49ee58370563d1ef0e0Tripp Y.delegate("click", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);
8b594f23b40af0ed8368f49ee58370563d1ef0e0Tripp Y.delegate("mousemove", Y.bind(this._positionTooltip, this), cb, markerClassName);
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp this._overlay.on("mousemove", Y.bind(this._planarEventDispatcher, this));
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp this.on(interactionType + "Event:" + hideEvent, this.toggleTooltip);
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp this.on(interactionType + "Event:" + showEvent, tt[interactionType + "EventHandler"]);
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp for(; i < len; ++i)
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp this.on(interactionType + "Event:" + hideEvent[i], this.hideTooltip);
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp this.on(interactionType + "Event:" + hideEvent, this.hideTooltip);
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Event handler for marker events.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _markerEventDispatcher
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Object} e Event object.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseover event.
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @event markerEvent:mouseover
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @preventable false
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @param {EventFacade} e Event facade with the following additional
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * properties:
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>node</dt><dd>The dom node of the marker.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>series</dt><dd>Reference to the series of the marker.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>index</dt><dd>Index of the marker in the series.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseout event.
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @event markerEvent:mouseout
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @preventable false
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @param {EventFacade} e Event facade with the following additional
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * properties:
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>node</dt><dd>The dom node of the marker.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>series</dt><dd>Reference to the series of the marker.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>index</dt><dd>Index of the marker in the series.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mousedown event.
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @event markerEvent:mousedown
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @preventable false
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @param {EventFacade} e Event facade with the following additional
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * properties:
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>node</dt><dd>The dom node of the marker.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>series</dt><dd>Reference to the series of the marker.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>index</dt><dd>Index of the marker in the series.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseup event.
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @event markerEvent:mouseup
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @preventable false
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @param {EventFacade} e Event facade with the following additional
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * properties:
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>node</dt><dd>The dom node of the marker.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>series</dt><dd>Reference to the series of the marker.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>index</dt><dd>Index of the marker in the series.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Broadcasts when `interactionType` is set to `marker` and a series marker has received a click event.
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @event markerEvent:click
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @preventable false
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * @param {EventFacade} e Event facade with the following additional
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * properties:
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>node</dt><dd>The dom node of the marker.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>
3534a81072e8770e29c90e09015e57e28b644dbcTripp * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>
3534a81072e8770e29c90e09015e57e28b644dbcTripp * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>series</dt><dd>Reference to the series of the marker.</dd>
1dc743f5ebb81123e0c921f2d70392f1d160ddbfTripp * <dt>index</dt><dd>Index of the marker in the series.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>
3534a81072e8770e29c90e09015e57e28b644dbcTripp * <dt>originEvent</dt><dd>Underlying dom event.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Event handler for dataProviderChange.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _dataProviderChangeHandler
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Object} e Event object.
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * Event listener for toggling the tooltip. If a tooltip is visible, hide it. If not, it
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * will create and show a tooltip based on the event object.
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * @method toggleTooltip
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Object} e Event object.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Shows a tooltip
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _showTooltip
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {String} msg Message to dispaly in the tooltip.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Number} x x-coordinate
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Number} y y-coordinate
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Positions the tooltip
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _positionTooltip
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Object} e Event object.
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * Hides the default tooltip
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method hideTooltip
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Adds a tooltip to the dom.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _addTooltip
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Updates the tooltip attribute.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _updateTooltip
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Object} val Object containing properties for the tooltip.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @return Object
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Default getter for `tooltip` attribute.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _getTooltip
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @return Object
16178708ecddc36b034aea99e129ceffa009ac05Tripp msg = tt.markerLabelFunction.apply(this, [e.categoryItem, e.valueItem, e.index, e.series, e.seriesIndex]);
16178708ecddc36b034aea99e129ceffa009ac05Tripp msg = tt.planarLabelFunction.apply(this, [categoryAxis, e.valueItem, e.index, e.items, e.seriesIndex]);
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Formats tooltip text when `interactionType` is `planar`.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _planarLabelFunction
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Axis} categoryAxis Reference to the categoryAxis of the chart.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Array} valueItems Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>axis</dt><dd>The value axis of the series.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>key</dt><dd>The key for the series.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>value</dt><dd>The value for the series item.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Number} index The index of the item within its series.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Array} seriesArray Array of series instances for each value item.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Number} seriesIndex The index of the series in the `seriesCollection`.
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * @return {String | HTML}
16178708ecddc36b034aea99e129ceffa009ac05Tripp _planarLabelFunction: function(categoryAxis, valueItems, index, seriesArray, seriesIndex)
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp msg.appendChild(DOCUMENT.createTextNode(categoryAxis.get("labelFunction").apply(this, [categoryAxis.getKeyValueAt(this.get("categoryKey"), index), categoryAxis.get("labelFormat")])));
16178708ecddc36b034aea99e129ceffa009ac05Tripp for(; i < len; ++i)
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName + ": " + axis.get("labelFunction").apply(this, [axis.getKeyValueAt(valueItem.key, index), axis.get("labelFormat")])));
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Formats tooltip text when `interactionType` is `marker`.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _tooltipLabelFunction
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Object} categoryItem An object containing the following:
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>axis</dt><dd>The axis to which the category is bound.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>key</dt><dd>The key of the category.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>value</dt><dd>The value of the category</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Object} valueItem An object containing the following:
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>key</dt><dd>The key for the series.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * <dt>value</dt><dd>The value for the series item.</dd>
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Number} itemIndex The index of the item within the series.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {CartesianSeries} series The `CartesianSeries` instance of the item.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Number} seriesIndex The index of the series in the `seriesCollection`.
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp * @return {String | HTML}
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName +
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp ": " + categoryItem.axis.get("labelFunction").apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")])));
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName +
1aaa0b228035b36e6e3b9548aff15b91fcbaf1cfTripp ": " + valueItem.axis.get("labelFunction").apply(this, [valueItem.value, valueItem.axis.get("labelFormat")])));
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Event handler for the tooltipChange.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _tooltipChangeHandler
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Object} e Event object.
97a5407d7fca2fea1fb9c9e7a7cc06183bc1c839Tripp * Updates the content of text field. This method writes a value into a text field using
97a5407d7fca2fea1fb9c9e7a7cc06183bc1c839Tripp * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first.
97a5407d7fca2fea1fb9c9e7a7cc06183bc1c839Tripp * @method _setText
97a5407d7fca2fea1fb9c9e7a7cc06183bc1c839Tripp * @param label {HTMLElement} label to be updated
97a5407d7fca2fea1fb9c9e7a7cc06183bc1c839Tripp * @param val {String} value with which to update the label