Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7606627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:27:27+00:00 2026-05-31T00:27:27+00:00

I got a Bar Chart that extract its data from a HTML table in

  • 0

I got a Bar Chart that extract its data from a HTML table in the page.
http://www.highcharts.com/demo/column-parsed

How can I extract only one column of the table, if we follow the example above, the John comlumn…

This is the code that builds the serias

// the categories
options.xAxis.categories = [];
$('tbody th', table).each( function(i) {
    options.xAxis.categories.push(this.innerHTML);
});

// the data series
options.series = [];
$('tr', table).each( function(i) {
    var tr = this;
    $('th, td', tr).each( function(j) {
        if (j > 0) { // skip first column
            if (i == 0) { // get the name and init the series
                options.series[j - 1] = {
                    name: this.innerHTML,
                    data: []
                };
            } else { // add values
                options.series[j - 1].data.push(parseFloat(this.innerHTML));
            }
        }
    });
});

I have tried to read only the columns that are equal to 2, in order to reach the last one, and didn’t succeed

if (j == 2) { ... }

Hope anyone will have better answers than me.
Shlomi.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:27:29+00:00Added an answer on May 31, 2026 at 12:27 am

    Try this :

    options.series = [];
    $('tr', table).each( function(i) {
        var tr = this;
        $('th, td', tr).each( function(j) {
            if (j == 2) { // get only column 2
                if (i == 0) { // get the name and init the series
                    options.series[0] = {
                        name: this.innerHTML,
                        data: []
                    };
                } else { // add values
                    options.series[0].data.push(parseFloat(this.innerHTML));
                }
            }
        });
    });
    

    You need to check that j == 2 so that you only get the data in the 2nd column and then when you create the options.series array you need to use 0 – Highcharts expects at least data in series[0]

    Working Example here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a menu bar that slides across the page when an image is
got a new blog at wordpress few days ago ( http://ghads.wordpress.com ) and I
I've got stacked bar chart where I want to be able to select individual
I've got a bar's graphic in a chart control in my app. I've set
Let's say I've got this XAML (created with Live ChartBuilder ): <Grid xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:sys=clr-namespace:System;assembly=mscorlib
I've got a string like Foo: Bar that I want to use as a
We've got some data (10-50 columns, hundreds of thousands of rows) that we usually
In VB.net I've got the following line that removes all non-alphanumeric chars from a
I've got a string like foo (123) bar I want to retrieve all numbers
I've got a bunch of text like this: foo bar baz What's likely to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.