I have a line graph, and I wish to add a single line(eg. average line) to the graph. I know you can add another series, but I have to add an extra field with identical value to all my data points if i want to do it this way.
Is there a better way?
I have a line graph, and I wish to add a single line(eg. average line) to the graph. I know you can add another series, but I have to add an extra field with identical value to all my data points if i want to do it this way.
Is there a better way?
Don't waste cycles looking for an optimizing solution for this when a satisficing solution will do. You can always come back and optimize if needed.
JorgeRamon.me
Free Tutorials: Sencha Touch Tutorials | Ext JS Tutorials | jQuery Mobile Tutorials
Follow: Twitter | LinkedIn
true, but if I emulate a straight line graph by many points of the same y value, how do I remove the points so it looks like a straight line.
You could use a transparent image as the data point, for example:
Code:series: [{ type: 'line', displayName: 'Movies', yField: 'movies', style: { color: 0xCCCCCC, image: Ext.BLANK_IMAGE_URL } }]
JorgeRamon.me
Free Tutorials: Sencha Touch Tutorials | Ext JS Tutorials | jQuery Mobile Tutorials
Follow: Twitter | LinkedIn
Or, change the color, alpha, fillColor and fillAlpha to achieve transparency:
Code:series: [{ type: 'line', displayName: 'Average', yField: 'average', style: { color: 0xCCCCCC, alpha:0, fillColor: 0xCCCCCC, fillAlpha:0 } }]
Last edited by MiamiCoder; 15 Mar 2010 at 5:26 AM. Reason: Fixed typo.
JorgeRamon.me
Free Tutorials: Sencha Touch Tutorials | Ext JS Tutorials | jQuery Mobile Tutorials
Follow: Twitter | LinkedIn