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 8074547
In Process

The Archive Base Latest Questions

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

I need to create the column chart/Bar chart using CSV data. Here’s the data’s

  • 0

I need to create the column chart/Bar chart using CSV data. Here’s the data’s format:

A 156600 154965  45679  184736 160819 42329
B 7271   4537    5379   245    0      1941
C 4347   19143   1075   397    6860   0
D 15     11283   1477   0      0      0
E 6323   537697  222430 21701  98725  3792
F 0      0       0      0      0      0
G 284356 744986  616369 0      0      106877
H 0      0       0      0      0      0
I 0      0       0      32962  0      0
J 0      12742   616    0      0      0
K 0      1215413 1420   0      0      0
L 0      0       0      0      0      0
M 24191  50166   18163  55282  48262  5862
N 0      0       0      0      0      20396

Here I will add the X- axis categories manually. So, I want to create the chart like
the one seen here

I made this:

$(document).ready(function() {
    var options = {
        chart: {
            renderTo: 'container',
            defaultSeriesType: 'column'
        },
        title: {
            text: 'Total Transactions'
        },
        xAxis: {
           categories: [],labels : { y : 20, rotation: -45, align: 'right' }
        },
        yAxis: {
            title: {
                text: 'Units'
            }
        },
        series: []
    };

    $.get('data.csv', function(data) {
        // Split the lines
        var lines = data.split('\n');
                var series = { 
                    name: 'Transactions ',
                    data: []
                };
        $.each(lines, function(lineNo, line) {

            var items = line.split(',');
            if (lineNo != 0) {
                $.each(items, function(itemNo, item) {
                        if (itemNo == 0) {
                            options.xAxis.categories.push(item);
                        } else if (itemNo == 2){

                            series.data.push(parseFloat(item));
                        }
                });
            }

        });
        options.series.push(series);
        var chart = new Highcharts.Chart(options);
    });

});

But it’s taking the column wise value means:

156600
7271    
4347    
15  
6323    
0   
284356
0   
0   
0   
0   
0   
24191   
0   

But I need this instead:

  • For A (like Jan), the value should be

    156600 154965 45679 184736  160819  42329
    
  • For B (Like Feb), another column should have the values:

    7271 4537   5379    245 0   1941
    

Can you please help me out?

  • 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:41:18+00:00Added an answer on June 5, 2026 at 2:41 pm

    The way you have it now you will end up with 14 series each containing 6 data points. What you really need to do if you can is alter the csv file so that your columns represent the month and the rows represent the series like so:
    enter image description here

    Then you can create a array for each row and pass the array to the highchart. I think your code should work with the above csv structure, since you are performing the split based on \n.

    EDIT

    If you can not change the format of your CSV file then the below modified code should build the 6 series as you need them. It assumes that there is no headers for the columns or the rows. It also ignores the last two rows which extend beyond the 12 months of a year.

    $.get('data.csv', function(data) {
      var lines = data.split('\n');
      var series1 = {name: 'India', data: []};
      var series2 = {name: 'China', data: []};
      var series3 = {name: 'Australia', data: []};
      var series4 = {name: 'Shreelanka', data: []};
      var series5 = {name: 'US', data: []};
      var series6 = {name: 'Cuba', data: []};
    
      $.each(lines, function(lineNo, line) {
        var items = line.split(',');
        //IGNORE THE LAST TWO ROWS
        if (lineNo < 12) {
          $.each(items, function(itemNo, item) {
            if (itemNo == 0) {
              series1.data.push(parseFloat(item)); 
            } else if (itemNo == 1){
              series2.data.push(parseFloat(item));
            } else if (itemNo == 2){
              series3.data.push(parseFloat(item));
            } else if (itemNo == 3){
              series4.data.push(parseFloat(item));
            } else if (itemNo == 4){
              series5.data.push(parseFloat(item));
            } else if (itemNo == 5){
              series6.data.push(parseFloat(item));
            }
          });
        }
      });
      options.series.push(series1);
      options.series.push(series2);
      options.series.push(series3);
      options.series.push(series4);
      options.series.push(series5);
      options.series.push(series6);
      var chart = new Highcharts.Chart(options);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .csv file containing 3 columns of data. I need to create
I need to create a column chart from values that I have stored in
Please I need help , I need to create six chart with the SAME
I need to create a chart in excel in a delphi application based on
I am using excel to draw charts from c#, but i need the chart
I'm trying to create a chart using the Google Visualization API, with PHP &
If I create column chart that has values that are > 0 but much
I need to create a column that will store hours bigger than 24. For
i need to create a highcharts chart with HH:MM on the y axis, Is
I need to create some xaml that shows text in columns like newspaper, something

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.