Skip to content
This repository has been archived by the owner on Apr 24, 2019. It is now read-only.

Commit

Permalink
working on new charts
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Hall committed May 5, 2011
1 parent 72e379a commit f4b4445
Show file tree
Hide file tree
Showing 36 changed files with 12,746 additions and 1,129 deletions.
5 changes: 5 additions & 0 deletions css/yuiapp.css
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,8 @@ a.big-button:hover {
.bd div.ticket .float-box span { font-size:77%; }
.bd div.ticket h4 { font-size:108%; font-weight:bold; }
.bd div.ticket .markdown { clear:both; }

.chart {
width:100%;
height:350px;
}
7 changes: 2 additions & 5 deletions inc/footer.inc.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<div id="ft"></div>
</div>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.fancybox-1.2.1.pack.js"></script>
<script type="text/javascript" charset="utf-8">
$(".fb").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false });
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<script src="js/highcharts.js" type="text/javascript"></script>
</body>
</html>
1 change: 0 additions & 1 deletion inc/header.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css">
<link rel="stylesheet" href="css/yuiapp.css" type="text/css">
<link rel="stylesheet" href="js/jquery.fancybox.css" type="text/css" media="screen">
</head>
<body class="rounded">
<div id="doc3" class="yui-t6">
Expand Down
12 changes: 12 additions & 0 deletions js/adapters/mootools-adapter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

244 changes: 244 additions & 0 deletions js/adapters/mootools-adapter.src.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
/**
* @license Highcharts JS v2.1.4 (2011-03-30)
* MooTools adapter
*
* (c) 2010 Torstein Hønsi
*
* License: www.highcharts.com/license
*/

// JSLint options:
/*global Highcharts, Fx, $, $extend, $each, $merge, Events, Event */

(function() {

var win = window,
legacy = !!win.$merge
$extend = win.$extend || function() {
return Object.append.apply(Object, arguments)
};

win.HighchartsAdapter = {
/**
* Initialize the adapter. This is run once as Highcharts is first run.
*/
init: function() {
var fxProto = Fx.prototype,
fxStart = fxProto.start,
morphProto = Fx.Morph.prototype,
morphCompute = morphProto.compute;

// override Fx.start to allow animation of SVG element wrappers
fxProto.start = function(from, to) {
var fx = this,
elem = fx.element;

// special for animating paths
if (from.d) {
//this.fromD = this.element.d.split(' ');
fx.paths = Highcharts.pathAnim.init(
elem,
elem.d,
fx.toD
);
}
fxStart.apply(fx, arguments);
};

// override Fx.step to allow animation of SVG element wrappers
morphProto.compute = function(from, to, delta) {
var fx = this,
paths = fx.paths;

if (paths) {
fx.element.attr(
'd',
Highcharts.pathAnim.step(paths[0], paths[1], delta, fx.toD)
);
} else {
return morphCompute.apply(fx, arguments);
}
};

},

/**
* Animate a HTML element or SVG element wrapper
* @param {Object} el
* @param {Object} params
* @param {Object} options jQuery-like animation options: duration, easing, callback
*/
animate: function (el, params, options) {
var isSVGElement = el.attr,
effect,
complete = options && options.complete;

if (isSVGElement && !el.setStyle) {
// add setStyle and getStyle methods for internal use in Moo
el.getStyle = el.attr;
el.setStyle = function() { // property value is given as array in Moo - break it down
var args = arguments;
el.attr.call(el, args[0], args[1][0]);
}
// dirty hack to trick Moo into handling el as an element wrapper
el.$family = el.uid = true;
}

// stop running animations
HighchartsAdapter.stop(el);

// define and run the effect
effect = new Fx.Morph(
isSVGElement ? el : $(el),
$extend({
transition: Fx.Transitions.Quad.easeInOut
}, options)
);

// special treatment for paths
if (params.d) {
effect.toD = params.d;
}

// jQuery-like events
if (complete) {
effect.addEvent('complete', complete);
}

// run
effect.start(params);

// record for use in stop method
el.fx = effect;
},

/**
* MooTool's each function
*
*/
each: function(arr, fn) {
return legacy ?
$each(arr, fn) :
arr.each(fn);
},

/**
* Map an array
* @param {Array} arr
* @param {Function} fn
*/
map: function (arr, fn){
return arr.map(fn);
},

/**
* Grep or filter an array
* @param {Array} arr
* @param {Function} fn
*/
grep: function(arr, fn) {
return arr.filter(fn);
},

/**
* Deep merge two objects and return a third
*/
merge: function() {
var args = arguments,
args13 = [{}], // MooTools 1.3+
i = args.length,
ret;

if (legacy) {
ret = $merge.apply(null, args);
} else {
while (i--) {
args13[i + 1] = args[i];
}
ret = Object.merge.apply(Object, args13);
}

return ret;
},

/**
* Hyphenate a string, like minWidth becomes min-width
* @param {Object} str
*/
hyphenate: function (str){
return str.hyphenate();
},

/**
* Add an event listener
* @param {Object} el HTML element or custom object
* @param {String} type Event type
* @param {Function} fn Event handler
*/
addEvent: function (el, type, fn) {
if (typeof type == 'string') { // chart broke due to el being string, type function

if (type == 'unload') { // Moo self destructs before custom unload events
type = 'beforeunload';
}

// if the addEvent method is not defined, el is a custom Highcharts object
// like series or point
if (!el.addEvent) {
if (el.nodeName) {
el = $(el); // a dynamically generated node
} else {
$extend(el, new Events()); // a custom object
}
}

el.addEvent(type, fn);
}
},

removeEvent: function(el, type, fn) {
if (type) {
if (type == 'unload') { // Moo self destructs before custom unload events
type = 'beforeunload';
}


el.removeEvent(type, fn);
}
},

fireEvent: function(el, event, eventArguments, defaultFunction) {
// create an event object that keeps all functions
event = new Event({
type: event,
target: el
});
event = $extend(event, eventArguments);
// override the preventDefault function to be able to use
// this for custom events
event.preventDefault = function() {
defaultFunction = null;
};
// if fireEvent is not available on the object, there hasn't been added
// any events to it above
if (el.fireEvent) {
el.fireEvent(event.type, event);
}

// fire the default if it is passed and it is not prevented above
if (defaultFunction) {
defaultFunction(event);
}
},

/**
* Stop running animations on the object
*/
stop: function (el) {
if (el.fx) {
el.fx.cancel();
}
}
}

})();
14 changes: 14 additions & 0 deletions js/adapters/prototype-adapter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f4b4445

Please sign in to comment.