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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:36:13+00:00 2026-05-18T08:36:13+00:00

I am trying to update a dojo Pie chart using the updateSeries method. I

  • 0

I am trying to update a dojo Pie chart using the updateSeries method. I invoke the method after performing an ajax call to get an updated javascript array data.

Here is the Javascript:

var eventByReasonsData = .... //gets populated on jsp page compile 

var theme = dojox.charting.themes.Julie;

var eventReasonsChart = null;


function makeEventsByReason() {

    var dc = dojox.charting;
    eventReasonsChart = new dc.Chart2D("eventsByReasonChart");
    eventReasonsChart.setTheme( theme ).addPlot("default", {
        type: "Pie",
        font: "normal normal 8pt Tahoma",
        fontColor: "black",
        labelOffset: -20,
        radius: 100

    }).addSeries("eventSeries", eventByReasonsData );

    var anim_a = new dc.action2d.MoveSlice(eventReasonsChart, "default");

    var anim_b = new dc.action2d.Highlight(eventReasonsChart, "default");

    var anim_c = new dc.action2d.Tooltip(eventReasonsChart, "default");

    eventReasonsChart.render();


}

Here is my HTML:

        <div id="eventsByReasonChart" ></div>

And here is the javascript making the AJAX call:

     new Ajax.Request( url, {
        method: 'post',
        parameters: params,
        onComplete: function(response) {


            if( response.responseText != "empty" )
            {
                var chart = eventReasonsChart;

                eventByReasonsData = response.responseText;

                chart.updateSeries( "eventSeries", eventByReasonsData );

                chart.render();                                                 
            }

        }
    });

Lastly, here is how my data is formatted when being sent to the chart:

[{ y:48 },{ y:1 },{ y:1 },{ y:14 },{ y:7 },{ y:3 },{ y:8 }]

When the Chart is initially drawn, everything is cool, no problems. AFter making the Ajax call, i receive the new data, the update call is made and the chart disappears. No errors that I can see on the console.

any ideas?

  • 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-18T08:36:13+00:00Added an answer on May 18, 2026 at 8:36 am

    I suspect that eventByReasonsData is a string, when updateSeries() expects an array. You can use dojo.fromJson() to convert the string to an array:

    chart.updateSeries( "eventSeries", dojo.fromJson(eventByReasonsData) );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a filtering select work with a Dojo enabled form using
Im trying to update my DB using AJAX and PHP. I'm sure everything is
i'm using Dojo 1.6 and trying to update an Html-Store with new data using
When trying to update a subversion working copy from Netbeans, I get the following
Im trying to update the contents of an element after running some php code.
I'm trying to update row in a table using values from a different row
im trying to update my news feed on facebook. Im using the new graph
I'm trying to update a model with nested properties after an edit. The update
I'm having a bit of a time trying to get Dojo grids (1.5) to
im trying to update my table using the following query... $query = mysql_query(UPDATE `outgoings`

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.