-
9 Aug 2011 6:41 AM #1
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
}
-
9 Aug 2011 7:05 AM #2
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
Does that help?
- Row 1
-
9 Aug 2011 7:14 AM #3
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...
-
9 Aug 2011 10:52 AM #4
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.
-
16 Aug 2011 9:37 AM #5
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.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote