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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:39:32+00:00 2026-06-12T16:39:32+00:00

How can i get access to a dojox-chart and fetch it as a js-object?

  • 0

How can i get access to a dojox-chart and fetch it as a js-object?
In a normal dijit widget it works with registry.byId("id") but this doesnt work with a dojox-chart.

I’ve also tried it with dom.byId, but i need it as an object to call functions, not as a dom-node.

Here is my code:

    <!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="dijit/themes/claro/claro.css">
<script>dojoConfig = {async: true}</script>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/dojo.js"></script>
<script>
require(["dojox/charting/Chart", "dojox/charting/axis2d/Default", "dojox/charting/plot2d/Lines", "dojox/charting/plot2d/Grid", "dojox/charting/themes/Claro", "dojo/ready"],
  function(Chart, Default, Lines, Grid, theme, ready){
  ready(function(){
    var chart1 = new Chart("chartId");
    chart1.setTheme(theme);
    chart1.addPlot("default", {type: Lines});
    chart1.addPlot("Grid", {type: "Grid"});
    chart1.addAxis("x",{}); 
    chart1.addAxis("y", {vertical: true});
    chart1.addSeries("Visits",[
        { x: 1, y: 200 },
        { x: 2, y: 185 },
        { x: 3, y: 100 },
        { x: 4, y: 110 },
        { x: 5, y: 130 },
        { x: 6, y: 70 },
        { x: 7, y: 30 },
        { x: 8, y: 200 }
    ]);

    chart1.render();
  });
});
require(["dojo/ready", "dijit/form/Button", "dojo/dom"], function(ready, Button, dom){
    ready(function(){
        var button = new Button({
            label: "Change my label"
        }, "buttonId");
    });
});

function tryToAccess()
{
    require(["dojo/ready", "dijit/registry", "dojo/dom"], function(ready, registry, dom){
        ready(function(){
            var button = registry.byId("buttonId");
            console.log(button); /*returns an object*/
            button.set("label","successfully changed!");

            /*var chart = ????????????????; */
        });
    });
}
</script>
</head>
<body class="claro">
<button id="buttonId"></button>
<div id="chartId" style="height: 300px;"></div>

<!-- JUST 4 DEBUGGING -->
<button onClick="tryToAccess();">try to access</button>
</body>
</html>
  • 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-12T16:39:33+00:00Added an answer on June 12, 2026 at 4:39 pm

    dojox.charting.Chart is not a widget, try using dojox.charting.widget.Chart instead. I think registry.byId would work with that.

    var chart1_widget = new Chart({}, "chartId");
    var chart1 = chart1_widget.chart;
    chart1.setTheme(theme);
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can you get access to the dynamically-changing coordinates of a draggable object? I
Each request in my web app can get one data access object instance (of
I'm trying to access a member structs variables, but I can't seem to get
Is there a way so that I can get access to request object, while
I can get access to the HttpServlet Request object in a soap web service
Is there any really low level programming language that can get access the memory
How can I get access to the iPhone clipboard whilst using PhoneGap? I cannot
I'd like to have access to one my model field verbose_name. I can get
How can I get the field names of an MS Access database table? Is
I can't get the list of my test users with my app access token.

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.