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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:18:26+00:00 2026-06-15T02:18:26+00:00

getting data from php page and I am passing chartData array to pie(title,chartData) function

  • 0

getting data from php page and I am passing chartData array to pie(title,chartData) function as second parameter.
Now chartData array is placing in data: [ chartData ] but it not working.
But when I add manually with key then It work data: [ chartData[0],chartData[1], ].
But I don’t want to mention it manually with key. I want to arry work automatically like data: [ chartData ]
What I have to do?

function createChart(chart) {
if ( chart == 'pie' ) {     

    var title = $("#chart-title").val();        

    /***************** Data Elements ****************/
    var totalElements = $("#addMoreRowNo").val();

    var chartData = new Array();
    for(var j = 1; j <= totalElements; j++)
    {                       
        var key = $("#chart-pie-text_"+j).val();
        var value = $("#chart-pie-percentage_"+j).val();
        var data = [key, parseFloat(value)];
        chartData[j-1] = data;
    }       
    /***************** Data Elements ****************/

    pie(title,chartData);
  }
}


function pie(title,chartData) {
var chart;

chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container',
        plotBackgroundColor: null,
        plotBorderWidth: null,
        plotShadow: false
    },
    title: {
        text: title
    },
    tooltip: {
        pointFormat: '{series.name}: <b>{point.percentage}%</b>',
        percentageDecimals: 1
    },
    plotOptions: {
        pie: {
            allowPointSelect: true,
            cursor: 'pointer',
            dataLabels: {
                enabled: true,
                color: '#000000',
                connectorColor: '#000000',
                formatter: function() {
                    return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
                }
            }
        }
    },
    series: [{
        type: 'pie',
        name: 'Browser share',
        data: [

           chartData      
               /*chartData[0],
               chartData[1],*/

            //['Active Postings (13)', 20.00],

        ]
    }]
});    
 }
  • 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-15T02:18:27+00:00Added an answer on June 15, 2026 at 2:18 am

    I’m pretty sure your problem can be solved by replacing

    data: [
      chartData
    ]
    

    with

    data : chartData
    

    The way you’re writing it, you’re defining data as an array containing chartData, which itself is an array. The way you indicate you’re testing it, though, is to get the items out of chartData and put each item into data, which results in a different structure.

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

Sidebar

Related Questions

I want redirect to a specific page in php by getting data from 3(multiple)
I am getting data from iphone using php but when i insert post data
how can i getting data from listbox in second form named listform while i
I'm passing information from one page another with following php code.. Index.php page: <?php
I have a php page that recalls data from an SQL table, and then
I'm having some headaches with dates in PHP. I'm getting some data from a
Im getting data from a server by executing this code: - (void) sendGeneral:(NSString *)
I am getting data from server it gives in response a NSString which hase
i am getting following error while getting data from dictionary -[__NSCFString objectForKey:]: unrecognized selector
I have the following two methods for getting data from my database: - (void)

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.