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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:33:25+00:00 2026-05-30T07:33:25+00:00

I am still a newbie in dojo and javascript so this may be trivial.

  • 0

I am still a newbie in dojo and javascript so this may be trivial.
I have created a “dojox.charting.Chart2D”-chart.
I get the data from a datastore (ItemFileReadStore) and can successfully display them in my DataSeries.
I can also create my x a y Axis but the only contain simple numbers.
What i need is to add to my x-Axis the text values from one field in my store.
I found that this could be done with “labelFunc: function (n) {}” but i simply can’t get it to read the data from my store.

My store data looks like this:

{ identifier: "UniqueId"  , items: [
{"UniqueId":1, "VisitDate":"2012-02-21T00:00:00", "VisitsTotal":407, "Visits10":71, "Visits15":6},
{"UniqueId":2, "VisitDate":"2012-02-20T00:00:00", "VisitsTotal":508, "Visits10":80, "Visits15":10},
...  

My code is like this:

var store = new dojo.data.ItemFileReadStore({ url: './../Data/MyJSONData.aspx' });
chart1 = new dojox.charting.Chart2D("simplechart1");  
chart1.addAxis("x", {fixUpper: "major",fixLower: "minor",title: 'Datum',
labelFunc: function (n) {
// HOW DO I GET THE VALUES 'VisitDate' FROM MY STORE ???
}});

chart1.addSeries('VisitsTotal',
new dojox.charting.DataSeries(store, { query: { Visits10: "*"} }, "Visits10"),
{ stroke: 'red', fill: 'pink' }
);

chart1.addSeries('Visits10',
new dojox.charting.DataSeries(store, { query: { Visits10: "*"} }, "Visits10"),
{ stroke: 'red', fill: 'pink' }
);
...

I already tried any combination but i really am missing some basics, on how to read from the store and also how to set my own text values (labels) to my X-Axis.

Thank you in advance.

  • 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-30T07:33:27+00:00Added an answer on May 30, 2026 at 7:33 am

    Add (labels) to X-Axis.

    chart1.addAxis("x", { labels: [{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"}]
        });
    

    Or see in My jsfiddle.

    Read data from the store

    store.fetch( { query: {},  
                   onItem: function(item) {
                      console.log(store.getValue( item, 'VisitDate' ) );
                   }
    });
    

    See more at Dojo Livedoc or stackoverflow

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

Sidebar

Related Questions

I'm still a newbie at flash, but is it possible to have Flash get
Alright, I'm still a newbie in Perl, so the answer to this question may
I'm realizing what a newbie I still am with this problem I have. I
Ok, this is about to drive me nuts. I'm still a newbie (and maybe
I am an Objective-C newbie, who still does not have a Mac, but still
I'm still a newbie to rails. This is going to sound dart. I am
Let me preface this with saying I am still a newbie when it comes
I'm still a newbie to Android but have searched high and low for an
I have the following code. I'm still a newbie in Ruby on Rails. As
Still somewhat of a newbie... I have an NSMutableArray that stores filenames - when

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.