Skip to content

Commit

Permalink
remove some options
Browse files Browse the repository at this point in the history
  • Loading branch information
eads committed Jul 26, 2012
1 parent b306ced commit 8b7addc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 41 deletions.
4 changes: 2 additions & 2 deletions examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<script type="text/javascript">
(function($) {
function updateTable(scale) {
$('#animate-formula').find('tbody').find('td').each(function(i) {
$(this).text( Math.pow(i, scale * .17) );
$('#animate-formula tbody td').each(function(i) {
$(this).text( Math.pow(i, (0.05 * scale)) );
});
}
function createTable() {
Expand Down
43 changes: 4 additions & 39 deletions jquery.tablechart.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,52 +149,17 @@ $.tablechart.parseFloat = function(el) {
return parseFloat($(el).text());
}

/**
* Constant for replacement
*/
$.tablechart.REPLACE = ['renderer', 'markerRenderer', 'labelRenderer', 'parseX',
'parseY', 'scrapeSingle', 'scrapeMultiple', 'tickRenderer',
'processSeries', 'formatter', 'tooltipContentEditor'];

/**
* Utility function: Replace whitelisted string options with their
* function callback.
*/
$.tablechart.replaceOptions = function(obj) {
if (!obj) {
return obj;
}
$.each(obj, function(key, val) {
if (typeof val == 'object') {
obj[key] = $.tablechart.replaceOptions(val);
}
else if (typeof val == 'string' && $.inArray(key, $.tablechart.REPLACE) > -1) {
namespaces = val.split(".");
func = namespaces.pop();
context = window;
for (var i = 0; i < namespaces.length; i++) {
context = context[namespaces[i]];
}
obj[key] = context[func];
}
});
return obj;
}


/**
* Defaults
*/
$.fn.tablechart.defaults = {
height: null,
width: null,
chartName: 'default',
headerSeriesLabels: true,
parseX: $.tablechart.parseText,
parseY: $.tablechart.parseFloat,
scrapeSingle: $.tablechart.scrapeSingle,
scrapeMultiple: $.tablechart.scrapeMultiple,
attachMethod: function(container) { $(this.el).before(container); },
parseX: parseText,
parseY: parseFloat,
//scrapeSingle: $.tablechart.scrapeSingle,
//scrapeMultiple: $.tablechart.scrapeMultiple,
plotOptions: {
series: [],
seriesColors: [ '#b2182b', '#2166ac', '#542788', '#b35806', '#8073ac', '#fdb863' ],
Expand Down

0 comments on commit 8b7addc

Please sign in to comment.