This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var removeSeriesByKey = function(chart, keyToDelete) { | |
| var newDataProvider = [], | |
| oldDataProvider = chart.get("dataProvider"), | |
| oldItem, | |
| newItem, | |
| key, | |
| i, | |
| newSeriesStyles = {}, | |
| seriesCollection = chart.get("seriesCollection"), | |
| seriesMap = chart.get("graph").get("seriesDictionary"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var getNewDataProvider = function(olddata, newdata) { | |
| var firstArray, | |
| secondArray, | |
| firstLength, | |
| newDataProvider = [], | |
| firstDate, | |
| secondDate, | |
| firstItem, | |
| secondItem, | |
| tempItem, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| YUI.add('charts-annotations', function (Y) { | |
| /** | |
| * Allows for the creation of annotations for a chart. | |
| * | |
| * @module charts-annotations | |
| */ | |
| /** | |
| * Creates a marker that can be used as an annotation. | |
| * | |
| * @class AnnotationMarker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function normalizeForDST(dataProvider, key) { | |
| var dateKey = key || "date", | |
| len = dataProvider.length, | |
| dsd = new Date("3/11/2013").valueOf(), | |
| min = new Date(dataProvider[0][dateKey]).valueOf(), | |
| max = new Date(dataProvider[len - 1][dateKey]).valueOf(), | |
| multiplier = (1000 * 60 * 60)/(len - 1), | |
| i, | |
| day; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mychart = new Y.Chart({ | |
| dataProvider:myDataValues, | |
| legend: { | |
| position: "right" | |
| }, | |
| seriesCollection: [ | |
| { | |
| yKey: "successes", | |
| styles: { | |
| marker: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| YUI({ | |
| filter:"raw" | |
| }).use('graphics', function (Y) | |
| { | |
| var w = 300, | |
| h = 200, | |
| ew = 15, | |
| eh = 15, | |
| mygraphic = new Y.Graphic({ | |
| render: "#mygraphiccontainer" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function MockNode() {} | |
| MockNode.prototype = { | |
| getDOMNode: function() { | |
| return this; | |
| }, | |
| append: function(val) { | |
| if(!this._children) { | |
| this._children = []; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| YUI().use('charts', function (Y) | |
| { | |
| var myDataValues = [ | |
| {category:"5/1/2010", miscellaneous:2000, expenses:3700, revenue:2200}, | |
| {category:"5/2/2010", miscellaneous:50, expenses:9100, revenue:100}, | |
| {category:"5/3/2010", miscellaneous:400, expenses:1100, revenue:1500}, | |
| {category:"5/4/2010", miscellaneous:200, expenses:1900, revenue:2800}, | |
| {category:"5/5/2010", miscellaneous:5000, expenses:5000, revenue:2650} | |
| ], | |
| mychart = new Y.Chart({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var myDataValues = [ | |
| {Iter:1, Generation:0, fitness:1.0542625639857393}, | |
| {Iter:1, Generation:1, fitness:0.4268963274830605}, | |
| {Iter:1, Generation:34, fitness:0.36754170974222156}, | |
| {Iter:2, Generation:0, fitness:1.483161509937983}, | |
| {Iter:2, Generation:1, fitness:0.20846076233482433}, | |
| {Iter:3, Generation:0, fitness:0.42917710631074113}, | |
| {Iter:3, Generation:19, fitness:0.3964440041134349}, | |
| {Iter:3, Generation:20, fitness:0.15911543465202604}, | |
| {Iter:3, Generation:94, fitness:0.12314257358831804}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var myTooltip = { | |
| planarLabelFunction: function(categoryAxis, valueItems, index, seriesArray, seriesIndex) | |
| { | |
| var doc = Y.config.doc, | |
| msg = doc.createElement("div"), | |
| valueItem, | |
| i = 0, | |
| len = seriesArray.length, | |
| axis, | |
| categoryValue, |