Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    392
    Vote Rating
    6
    gkatz is on a distinguished road

      0  

    Question Unanswered: trying to figure out axes definition in the line chart example

    Unanswered: trying to figure out axes definition in the line chart example


    Hi;
    in the chart examples there is a line chart example: http://dev.sencha.com/deploy/touch-c...examples/Line/
    what is the meaining of the fields attribute? there is a minimum and maximum defined for that axis, isnt this enough? also, what is the meaning of the series 1-3 names? they do not seam to refer to any JS var or any other definition in the example.
    thanks for your help.

    axes: [{
    type: 'Numeric',
    minimum: 0,
    maximum: 100,
    position: 'left',
    fields: ['Series 1', 'Series 2', 'Series 3'],
    title: 'Number of Hits',
    minorTickSteps: 1
    }

  2. #2
    Touch Premium Member
    Join Date
    Apr 2011
    Location
    Cary, NC
    Posts
    135
    Answers
    5
    Vote Rating
    0
    ChrisWalker is on a distinguished road

      0  

    Default


    The fields Series 1, Series 2 and Series 3 are defined in the store for your chart and is most likely a JSON object that was defined when the data was generated. What you are doing is mapping the Y value using the store's 'Series 1', 'Series 2' and 'Series 3' fields.
    Take a look at the store object right after its generated and note the values in Series 1, Series 2 and Series 3. You should also have another axis defined, most likely your X axis, that probably has 1 field defined. That is your X coordinate.

    For example if you have your axes { .... position:'bottom', fields:'month', ....} and you axes left (that you included)

    and you have 2 rows in your store:
    • Row 1
      • month: 'January'
      • Series 1: 10
      • Series 2: 15
      • Series 3: 8
    • Row 2
      • month: 'February'
      • Series 1: 12
      • Series 2: 6
      • Series 3: 10
    You would have a line chart with 3 lines with 2 points on each line.

    Does that help?

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Posts
    392
    Vote Rating
    6
    gkatz is on a distinguished road

      0  

    Default


    thanks @Chris;
    Actually, I still dont egt it. did you take a look at the link I pasted from the sencha examples? there is nothing called series 1..3 there...

  4. #4
    Touch Premium Member
    Join Date
    Apr 2011
    Location
    Cary, NC
    Posts
    135
    Answers
    5
    Vote Rating
    0
    ChrisWalker is on a distinguished road

      0  

    Default


    Sorry, I was in a meeting till now. I do see what you are talking about in the source now. I used the debug version of the touch-charts-debug.js to see what is going on. What I found was that the axis uses that list to determine if a field is bound to it. (Line 11812 in sencha-charts-touch.js release candiate). If it is not, which is the case in example code, it is ignored (filtered). Since 'Series 1', 'Series 2' and 'Series 3' is not in the store for this chart, no fields are bound to that particular axes.
    I am guessing that the fields for this axes were left in there by mistake and no one changed or removed them. Since they did not cause an error, no one saw the problem. Maybe those should have been 'data1', 'data2' and 'data3'.
    Only the developer could confirm why those were left in but I am guessing those values should not be there.

  5. #5
    Sencha User
    Join Date
    Nov 2010
    Posts
    168
    Vote Rating
    0
    philogb is on a distinguished road

      0  

    Default


    Hi Chris,

    I can confirm that this is the case. I think the error was fixed for the example in the final release of the framework.

Thread Participants: 2

Tags for this Thread