Results 1 to 2 of 2

Thread: Dynamically Changing the yField possible?

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    14
    Answers
    2
    Vote Rating
    -1
      0  

    Default Answered: Dynamically Changing the yField possible?

    I'm trying to make the data change in my line graph dynamically. I have it all under one store, where each year is a field as well as one field for the name of the category like so...

    Code:
    fields: ['name', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012'],
    each field will have different categories, so '2000', for example, will contain a value for say 'water', 'land', 'air'.

    in my line graph..
    Code:
    var date = 2000;
    ...
    Code:
    changeDate: function(newDate) {
            date = newDate;
    in the series field..
    Code:
    yField: [date]
    This seems to work for the first value I give to date, however, every time I call changeDate, the graph does not update with the new yField. Is there anything I have to do to refresh the graph so that it accepts a new value for the yField? Or is the yField a set value that does not change after the graph is rendered? I have tried redraw(), but the graph does not change.

    side note: This is similar to what EnergyChart does with the year graph. However, they change the content of their store every time. Is this the only solution to dynamic graphing?

  2. No, you will need to create a new chart if you want to change the yField.

  3. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,029
    Answers
    3976
    Vote Rating
    1367
      0  

    Default

    No, you will need to create a new chart if you want to change the yField.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •