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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:04:54+00:00 2026-05-17T03:04:54+00:00

I try hard to get some functional charts with dojo… I want to create

  • 0

I try hard to get some functional charts with dojo…

I want to create a stacked area chart with 3 lines. For the “bas”, “moy” and “haut” as you see in the JSON data.

    var jStore = {"identifier":"mois",
                "items":[{"mois":1,  "bas":98,   "moy":122.5,   "haut":147},
                         {"mois":2,  "bas":91,   "moy":113.75,  "haut":136.5},
                         {"mois":3,  "bas":91,   "moy":113.75,  "haut":136.5},
                         {"mois":4,  "bas":84,   "moy":105,     "haut":126},
                         {"mois":5,  "bas":77,   "moy":96.25,   "haut":115.5},
                         {"mois":6,  "bas":63,   "moy":78.75,   "haut":94.5},
                         {"mois":7,  "bas":49,   "moy":61.25,   "haut":73.5},
                         {"mois":8,  "bas":42,   "moy":52.5,    "haut":63},
                         {"mois":9,  "bas":49,   "moy":61.25,   "haut":73.5},
                         {"mois":10, "bas":70,   "moy":87.5,    "haut":105},
                         {"mois":11, "bas":77,   "moy":96.25,   "haut":115.5},
                         {"mois":12, "bas":84,   "moy":105,     "haut":126}]
             };

I want to put int the x axis the months as it seen in the code. Call the specific data in the JSON to create every line.

dojo.addOnLoad(function() {
                var chart1 = new dojox.charting.Chart2D('chart1');
                chart1.addPlot('default', {
                        type: 'StackedAreas',
                        markers: true,
                        tension: 'S',
                        lines: true,
                        areas: true,
                        labelOffset: -30,
                        shadows: {
                            dx:2, dy:2, dw:2
                        }
                     });
                chart1.addAxis('x', {max:12, 
                   labels:[
                      {value: 0, text: ""},
                      {value: 1, text: "Jan"},
                      {value: 2, text: "Feb"},
                      {value: 3, text: "Mar"},
                      {value: 4, text: "Apr"},
                      {value: 5, text: "May"},
                      {value: 6, text: "Jun"},
                      {value: 7, text: "Jul"},
                      {value: 8, text: "Aug"},
                      {value: 9, text: "Sept"},
                      {value: 10, text: "Oct"},
                      {value: 11, text: "Nov"},
                      {value: 12, text: "Dec"}
               ]});
                chart1.addAxis('y', { vertical: true, max:200, includeZero: true });
                chart1.addSeries('Basse', (jStore, {query: {bas: "*"}}, "bas"),{ stroke: 'red', fill: 'pink' });
                chart1.addSeries('Moyenne',(jStore, {query: {moy: "*"}}, "moy"), { stroke: 'green', fill: 'lightgreen' });
                chart1.addSeries('Haute',(jStore, {query: {haut: "*"}}, "haut"), { stroke: 'blue', fill: 'lightblue' });
                chart1.render();
                var anim1a = new dojox.charting.action2d.Magnify(chart1, "default");
                var anim1b = new dojox.charting.action2d.Tooltip(chart1, "default");
                var legend1 = new dojox.charting.widget.Legend({
                    chart:chart1
                },"legend1");
                chart1.render();
            });

It doesn’t work, I don’t know wath I have to put instead of (jStore, {query: {haut: "*"}}, "haut") to call my specific data.

please help ! thanx a lot.

  • 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-17T03:04:54+00:00Added an answer on May 17, 2026 at 3:04 am

    From the official docs Using dojo.data Data Sources with Charts:

    dojox.charting.DataSeries is used to connect to dojo.data stores. User should create it and pass it instead of a data array in chart.addSeries() call.

    Example of use can be found in dojox/charting/tests/test_DataSeries.html.

    Another missing piece in your example is a store object. Somehow you try to pass a JSON structure around, which has data, but no required methods. You should create a data store first from your data. I have no idea what data store you want to use, but if all you want is to show your data structure, you can use dojo.data.ItemFileReadStore:

    dojo.require("dojo.data.ItemFileReadStore");
    
    var jStore = ...; // not really a store, but your JSON-like object
    var realStore = new dojo.data.ItemFileReadStore({data: jStore});
    ...
    chart1.addSeries(
      'Basse',
      new dojox.charting.DataSeries(realStore, {query: {bas: "*"}}, "bas"),
      {stroke: 'red', fill: 'pink'}
    );
    

    Use link above to learn about dojox.charting.DataSeries. Read all about dojo.data in the official documentation: http://docs.dojocampus.org/dojo/data

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

Sidebar

Related Questions

This might be a little hard to explain, but I will try. I want
As hard as I try, PREG and I don't get along, so, I am
Kinda hard to explain, but i'll try. I have a datalist that is populated
It's quite hard to explain what I'm trying to do, I'll try: Imagine a
Overflow :3 I've got a kind of hard-case question. So I'll try clearly explain
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
Try as I might I cannot get my head around what the IteratorIterator class
I get this error when I try to build a release version of my
I'm writing some quick code to try and extract data from an mp3 file
I want to use a clause along the lines of CASE WHEN ... THEN

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.