PDA

View Full Version : multiple lines on a chart



hello
12 Mar 2010, 5:55 PM
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?

MiamiCoder
13 Mar 2010, 10:58 AM
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.

hello
13 Mar 2010, 3:44 PM
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.

MiamiCoder
13 Mar 2010, 6:47 PM
You could use a transparent image as the data point, for example:


series: [{
type: 'line',
displayName: 'Movies',
yField: 'movies',
style: {
color: 0xCCCCCC,
image: Ext.BLANK_IMAGE_URL
}
}]

MiamiCoder
14 Mar 2010, 11:35 AM
Or, change the color, alpha, fillColor and fillAlpha to achieve transparency:


series: [{
type: 'line',
displayName: 'Average',
yField: 'average',
style: {
color: 0xCCCCCC,
alpha:0,
fillColor: 0xCCCCCC,
fillAlpha:0
}
}]