Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Highcharts.visualize = function (table, options) {
- // the categories
- options.xAxis.categories = [];
- $('thead th:parent', table).each(function (i) {
- var month = $(this).text();
- options.xAxis.categories.push(month);
- });
- console.log(options.xAxis.categories);
- // tthe data series
- options.series = [];
- $('tbody tr', table).each(function (i) {
- var tr = this;
- var serie = {};
- serie.name = $('th', tr).text();
- serie.data = [];
- $('td', tr).each(function (j) {
- var amount = this.innerHTML;
- amount = amount.split('.').join("");
- serie.data.push(parseFloat(amount));
- });
- options.series.push(serie);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement