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

  • SEARCH
  • Home
  • 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 8073763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:26:22+00:00 2026-06-05T14:26:22+00:00

I am trying to use HighCharts’ HTML-table-to-chart script to create a line graph from

  • 0

I am trying to use HighCharts’ HTML-table-to-chart script to create a line graph from a table.

I want to have a datetime x-axis, so here is what I have done:

  • Use Date.parse(this.innerHTML) to convert row headers into date strings.
  • Set type to datetime in my xAxis options object.

The date conversion is working and appears correctly in the default tooltip, but the graph itself is treating the x values like categories, not datetimes. I’m assuming it has to do with how the point objects are set up, but I’m not sure how to fix it.

Highcharts.visualize = function(table, options) {

    // the categories
    options.xAxis.categories = [];

    $('tbody th', table).each(function(i) {
        var date = Date.parse(this.innerHTML);
        options.xAxis.categories.push(date);
    });

    // 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));
                }
            }
        });
    });

    charts[charts.length] = new Highcharts.Chart(options);
};

Any suggestions?

Here is a fiddle: http://jsfiddle.net/supertrue/et2Vy/

  • 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-06-05T14:26:24+00:00Added an answer on June 5, 2026 at 2:26 pm

    Highcharts treats the xAxis as categories because you tell it to do so.
    Here: options.xAxis.categories.push(date);

    You’ll have to use { x: xval, y: yval } (or [xval,yval]) as data type for your series.

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

Sidebar

Related Questions

I'm trying to use Highcharts to create a graph similar to what's shown below.
i have an error , when trying to use highcharts. javascript_include_tag jquery-1.4.2.min,rails,highcharts C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/jquery-rails-1.0.14/vendor/assets/javascripts/jquery.js isn't
I'm trying to use a jQuery plugin, the HighCharts, calling the series from a
I have been trying use zenity with standard re-direction in a shell script, something
I am trying to use highcharts to show some data over the last 24
I am trying use gem tire to search in my application. I have tables
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
Hi I'm trying use a datepicker on a field I have. I'm trying to
I have been trying use the edit_post_link() function to contain an image. All of
I have to create specific table in PHPTAL. I have array like that: $tab

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.