1. #1
    Sencha User
    Join Date
    Dec 2007
    Location
    Texas
    Posts
    19
    Vote Rating
    0
    zim312 is on a distinguished road

      0  

    Default Data question for Charting

    Data question for Charting


    I'm wanting to make a linechart that has bottom = week number, Left = Username
    If I have data that looks like this
    {username:'User1',Week:'1',Stat:'100'},{username:'User2',Week:'1',Stat:'102'},{username:'User1',Week:'2',Stat:'100'},{username:'User2',Week:'2',Stat:'94'}

    There aren't only 2 users.. there could be 50..
    Assume these are grades..
    How would I define a chart so that A line per user would show their grade history per week?

    I'd think this would be similar to showing the price for multiple company's stock across time on the same graph as well..

    Thanks!

  2. #2
    Sencha User darthwes's Avatar
    Join Date
    Mar 2010
    Posts
    633
    Vote Rating
    -11
    darthwes can only hope to improve

      0  

    Default


    You'd make a series config object for each student, and your store would have data formed like:

    [{
    user1: 97,
    user2: 83,
    user3: 45,
    week: 1
    }, {
    user1: 94,
    user2: 82,
    user3: 77,
    week: 2
    }]

    Happy hunting!
    Wes

  3. #3
    Sencha User
    Join Date
    Dec 2007
    Location
    Texas
    Posts
    19
    Vote Rating
    0
    zim312 is on a distinguished road

      0  

    Default


    Thats part of the problem.. say its a gradebook app.. and I've got data saved like I showed..
    I can adjust it to append a userid to the word User, and query the data based on weeks..
    so then I've got it looking like
    {Week:1, User1: 100, User2: 102},{Week:2,User1:100,User2:95}
    but when I'm defining the chart, Week is the only static value.. the other values could be anything.. how do I graph on that?
    ie..
    var chart3 = new Ext.chart.LineChart({
    store: mystore,
    url:'charts.swf',
    flex: 1,
    xField: 'Week'
    });
    what would the y Field be, or even a Series?
    and you can't assume the userid's are sequential, additions/deletions from the class list would make it somewhat variable as well..

  4. #4
    Sencha User darthwes's Avatar
    Join Date
    Mar 2010
    Posts
    633
    Vote Rating
    -11
    darthwes can only hope to improve

      0  

    Default


    You'd define the chart's series as an array of (series) objects. Each one would define the yField for that series. So you might have student1/user1 as the yField for series[0], and user2 as the yField for series[1], etc., etc.

    See the API/demos/Google/Forums/Friends for syntax/examples of charts using series.
    Wes

  5. #5
    Sencha User
    Join Date
    Dec 2007
    Location
    Texas
    Posts
    19
    Vote Rating
    0
    zim312 is on a distinguished road

      0  

    Default


    But thats part of the problem i'm having..

    how can I define a series w/ a yField identifier that I don't know of at the time I define the chart?

    Ex: I can't use User1, because User1 might not exist tomorrow.. (suppose the student moved)
    granted I could statically define a ySeries for all possible User+id (User#) that could exist..
    (Hopefully extjs would just ignore for data thats not there rather than a NaN response)
    but there's got to be a better way..

  6. #6
    Sencha User darthwes's Avatar
    Join Date
    Mar 2010
    Posts
    633
    Vote Rating
    -11
    darthwes can only hope to improve

      0  

    Default


    There's nothing stopping you from doing this dynamically. You can manage it however you choose, dynamically change the series and refresh the chart, or just rebuild a chart each time you reload the store.
    Wes

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi