Success! Looks like we've fixed this one. According to our records the fix was applied for a bug in our system in a recent build.
  1. #11
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    Boston
    Posts
    82
    Vote Rating
    5
    germanicus is on a distinguished road

      0  

    Default


    It's not in 4.0.7, it's in 4.1. It should be in the beta release.

  2. #12
    Sencha User
    Join Date
    Jul 2011
    Posts
    29
    Vote Rating
    0
    mario60 is on a distinguished road

      0  

    Default Ok, thks

    Ok, thks


    Ok, i see.
    Indeed, trick by jmitchell.bt works for me on v. 4.0.2:
    Code:
                    tips: {
                        trackMouse: true,
                        width:  150,
                        height: 60,
                        renderer: function(storeItem, item) {
                               for( var i = 0; i < item.series.items.length; i++ ){
                               if( item == item.series.items[i] ){
          itemsPerRec = item.series.items.length / item.storeItem.store.getCount();
                               J=item.series.yField[ i % itemsPerRec ];  }}
          this.update( String(item.value[0])+': '+'<b>' + J.capitalize() + '</b> = ' + String(item.value[1]));}}
    thks to all
    mario

  3. #13
    Sencha User
    Join Date
    Nov 2011
    Posts
    5
    Vote Rating
    0
    lukesen is on a distinguished road

      0  

    Default


    @jmitchell.br, @mario60: Had a similar problem, solved in a similar way. On a second pass, added code for dealing with hiding one or more yField(s) in GUI by clicking on the respective Legend items.
    In that case, the series.items array will only contain the visible items, so using the computed yField's index in the array with all yFields will always result in one of the first yFields, which is not always correct (e.g. if series.yField = ['one', 'two', 'three'] and the user clicks the first item in Legend and thus hides 'one', your code will always return the yField 'one' or ' two', instead of 'two' or 'three').
    To address this I built a second array with only the visible yFields, and used the computed index in that array instead of the original series.yField array. (To determine which yField(s) are visible, I used the series' visibleInLegend method).

    In 4.1 Beta 3 I see that there is an item.yField property (always String, indicating the current yField, not the array of yFields) which makes all these computations unnecessary. It also seems to work well when hiding yFields via click in the Legend. (In fact I think that the 4.0.x code will no longer work in 4.1 because 'storeItem' appears to no longer have a 'store' property but instead a 'stores' array property).

    Hope this helps.

Similar Threads

  1. Replies: 2
    Last Post: 20 Apr 2011, 10:09 AM
  2. [FIXED] Charts: binding series to axes
    By Nitro in forum Ext:Bugs
    Replies: 3
    Last Post: 3 Mar 2011, 3:31 PM
  3. how to define jsonstore for dynamic series in charts?
    By carrier24sg in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 1 Dec 2010, 3:58 PM
  4. how to add series on fly for charts
    By guessit in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 27 Sep 2010, 5:56 PM
  5. how t o add series on fly for charts
    By guessit in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 27 Sep 2010, 3:33 PM

Thread Participants: 6