score:2
Accepted answer
from your code it appears that your months are in thead
and not tbody
. so you should be really using $('thead th')
selector. i would also recommend using the :parent
selector to filter out empty th
s
$('thead th:parent', table).each( function(i) {
var month=$(this).text();
options.xaxis.categories.push(month);
});
also, your series data needs to be changed if you want the x-axis to be months, you should now have only 3 series, instead of the earlier 6. and each series will now have 6 points (one for each month) instead of previous 3 points/series. so your table parsing would need to change to something like this.
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) {
serie.data.push(parsefloat(this.innerhtml));
});
options.series.push(serie);
});
Source: stackoverflow.com
Related Query
- Reverse Axis in Highcharts get data from table
- get highcharts data from table angularjs
- How to populate a Highcharts axis with string formatted data from a PHP array
- Highcharts get data from database
- How To Get Data From Database To Highcharts Plugin in cakephp
- Extracting data from a JSON call to a Postgres table for use in Highcharts (without PHP)
- Highcharts loading data from a HTML table with a title
- How to make the Y Axis values not start from 0 in highcharts? How to display forcefully display the last category data on X axis in HighCharts ?
- Can we get index from series data in highcharts
- Highcharts display label for pie chart using html table as data source
- using dynamic data from highcharts in a html table
- Can I add on the webpage, data that I get from a Highcharts function?
- highcharts from HTML table does not getting the x axis key
- Loading string data from table gets parsed as Date on Chrome - Highcharts
- HTML table as data source for highstock charts using highcharts
- Fomatting labels on Y-axis in Highcharts with Data from HTML table
- Stacked Bar type of jquery Highcharts with data from HTML Table
- Highcharts column chart, disable interpolation when loading from data table
- Highcharts (Highstock): Get data from external CSV, doesn't display date correctly
- Configuring Data Table from Highcharts Basic Column Chart
- Plot Y axis data based on x axis values from a csv file : Highcharts
- how to make chart real time with 2 line and get data from php with highcharts
- get data from hashmap into highcharts
- Highcharts giving an extra legend when I get data dynamically from Highcharts
- Angular 5 - Highcharts cannot load data from a HTML table
- gow to get Highcharts solid Gauge data from a JS variable?
- Use HTML class as Highcharts table data source
- Invert axis on highchart diagram with data from table
- highcharts pulling data from database table
- Get Data from text and plot on Highcharts
More Query from same tag
- Highcharts: Is it possible to display series with the same name in different columns?
- Show time in HH:MM on Xaxis Highcharts
- Bar Chart Gauge Highcharts
- How to enable or disable a Highcharts tooltip when a button is clicked?
- Stacked Bar And Scatter Alignment
- ReferenceError: Highcharts is not defined when using lollipop series in react
- Plotting data onto highchart chart when series data uses named objects
- xAxis Categories Highcharts
- How do I initialize HighChart series values with AJAX?
- How to show two specific data points from tabular data in Highcharts?
- Highcharts does not resize charts inside tabs
- Is it possible to specify a date type to use?
- HighCharts: Updating stops in yAxis does not work
- highstocks, how can I bring values that I will only use on the 'click' option?
- Export to CSV button outside chart using Highcharts
- Highcharts set x-axis categories
- Manually Triggering drillup event, highcharts
- Abbreviating values of chart in tooltip
- How to make a chart with highcharts, load data from API
- Moving of series in Highcharts
- Stack bar chart is not updating highchart angular
- How to remove bottom zoom bar on highcharts?
- Highcharts - Change line style in line gaps (null)
- Highcharts: Force show a yAxis tick
- How to delete graph on click
- Highcharts - add custom information to tooltip what caused price raise or price drop
- Highchart Not Updating With Returned Ajax Data Object
- Highcharts: Corner radius for plot border
- How to draw two lines in HighStocks using candlestick with intraday
- Updating highcharts.js data on a 'stacked columns' chart : update() or setData()?