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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:28:48+00:00 2026-05-22T22:28:48+00:00

I am constructing a combination chart from an ajax json object consisting of a

  • 0

I am constructing a combination chart from an ajax json object consisting of a ‘spline’ and ‘pie’.

The problem I have is only the pie chart renders, its as though the pie overrides the spline. If i remove the pie chart the spline renders correctly.

Here is my code.

$(document).ready(function () {
var options = {
    chart: {
        renderTo: 'container'
    },
    title: {
        text: 'The Planning Process'
    },
    xAxis: {
        title: {
            text: 'Time'
        },
        type: 'datetime'
    },
    yAxis: {
        title: {
            text: 'Turn Over'
        }
    },
    plotOptions: {
        series: {}
    },
    series: []
};

$.ajax({
    type: "POST",
    dataType: "json",
    data: "{}",
    contentType: "application/json; charset=utf-8",
    url: "_services/ScriptService.asmx/getData",
    success: function (items) {

        var obj = jsonParse(items.d);
        var series = { data: [] };

        $.each(obj, function (itemNo, item) {
            if (itemNo == 0) {
                series.data = item.data;
                series.name = item.name;
                series.type = item.type;
            } else if (itemNo == 1) {
                series.type = item.type;
                series.data = item.data;
           series.name = item.name;
                series.center = item.center;
                series.size = item.size;
                series.showInLegend = item.showInLegend;
            }
        });

        options.series.push(series);

        chart = new Highcharts.Chart(options);
        console.log(options);

    },
    cache: false,
    error: function (XMLHttpRequest, textStatus, errorThrown) { alert(errorThrown); }
});  
});

And my json;

[{
    "name": "Projection",
    "type": "spline",
    "data": [
        [
            634420512000000000,
            100000
        ],
        [
            634421376000000000,
            100086
        ],
        [
            634422240000000000,
            100171
        ],
        [
            634423104000000000,
            100257
        ]
    ]
},
{
    "name": "Where you where",
    "type": "pie",
    "center": [
        100,
        80
    ],
    "size": 100,
    "showInLegend": false,
    "data": [
        {
            "name": "Client Based Adviser Charged As Percent",
            "color": "#4572A7",
            "y": 8
        },
        {
            "name": "Provider Commission Based As Percent",
            "color": "#AA4643",
            "y": 92
        }
    ]
}]

Could anyone point me as to where im going wrong?

  • 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-22T22:28:48+00:00Added an answer on May 22, 2026 at 10:28 pm
    success: function (items) {
    
        var obj = jsonParse(items.d);
    
        $.each(obj, function (itemNo, item) {
            series = new Array();
            if (itemNo == 0) {
                series.data = item.data;
                series.name = item.name;
                series.type = item.type;
            } else if (itemNo == 1) {
                series.type = item.type;
                series.data = item.data;
                series.name = item.name;
                series.center = item.center;
                series.size = item.size;
                series.showInLegend = item.showInLegend;
            }
            options.series.push(series);
        });
    
        chart = new Highcharts.Chart(options);
        console.log(options);
    
    },
    

    This loop never adds a second series, you are only getting the last one in the loop because it is over writing the one before.

    My changes may solve the problem, I am not near a computer at the moment to check.

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

Sidebar

Related Questions

Given: Constructing an ADO Connection object from one thread and giving it to another
I am constructing a large HTML document from fragments supplied by users that have
Constructing an OpenId provider, I've run into the curious problem that only Stack Exchange
when constructing an object using methods from other objects as an attribute name get
I have a problem constructing a DSL in Clojure. This is the concrete problem
I am constructing a URL and I have escape($('#count_of_stations').html() The problem is the value
I'm constructing an ecommerce application in Symfony, and I have a page which lists
I'm constructing a program which uses mprotect() to restrict a block of memory from
I'm constructing a SQL query for a business report. I need to have both
I have a method that is called on an object to perform some business

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.