Given the example above, is this recognised as a bug now?
Printable View
Given the example above, is this recognised as a bug now?
Change your series to this:
When I do that, the lines show very normally to me. I don't think it's a bug, but I certainly think it's a bad choice for them to have fills turned on by default. I think the default should be fillOpacity=0.Code:{ title:'Today', type:'line', xField:'c0', yField:'c1', style:{stroke:'red', fillOpacity:0} },
{ title:'MTD', type:'line', xField:'c0', yField:'c2', style:{stroke:'green', fillOpacity:0} },
{ title:'YTD', type:'line', xField:'c0', yField:'c3', style:{stroke:'blue', fillOpacity:0} }
Actually, I think I found the source of your problems. It's that "colors:" part. According to the docs, that part is only valid for pie series, even though it's (frustratingly) defined as part of Ext.chart.series.Series. I hate it when APIs do that. Anyway, if I comment out that part and put a style:{stroke:somecolor} on each of your series, it works as expected. No need to specify fillOpacity:0.
My guess is that something in the colors config being set on a Line series confuses the code.
Mitchell, could you provide some clarification here as to whether colors should be used and whether fillopacity is now required? thx
Yes, colors does need to be used for the fill. For fillopacity, I do not think this is required.
So the issue I had was that I was using colors as the stroke for each line on my line chart. However, specifying colors on a chart containing a line series infact creates a fill.
Would it not make more sense for the colors array to specify the stroke colors for the lines and for a fillOpacity > 0 to be set in order to display an area fill rather than have fill enabled by default?
Mitchell - The docs and how this works seems to directly contradict you.
fillOpacity is not required, can confirm that in 2.1.0 RC2 using the LineChart view in Kitchensink if you comment it out.
Using same view, the fill config is specified as a color attrib: '#115fa6' but if you change it to true then the colors on the chart is then required:
Code:{
xtype: 'chart',
store: 'USD2EUR',
background: 'white',
interactions: [
{
type: 'crosszoom',
zoomOnPanGesture: false
}
],
colors : ['#115fa6'],
series: [
{
type: 'line',
xField: 'time',
yField: 'value',
style: {
//fill: Kitchensink.view.ColorPatterns.getBaseColors(0),
fill : true,
//stroke: Kitchensink.view.ColorPatterns.getBaseColors(0),
//fillOpacity: 0.6,
miterLimit: 3,
lineCap: 'miter',
lineWidth: 2
}
}
],
axes: [
{
type: 'numeric',
position: 'left',
fields: ['value'],
title: {
text: 'USD to Euro',
fontSize: 20
}
},
{
type: 'time',
dateFormat: 'Y-m-d',
visibleRange: [0, 1],
position: 'bottom',
fields: 'time',
title: {
text: 'Date',
fontSize: 20
}
}
]
}
You know, I often have feature enhancements rejected because they would complicate the API too much. And yet, we get this. Quite complicated! Anyway, the docs REALLY should be updated with this stuff before it's finally released. As it stands, it claims the Series#color config is only ever used for Pie series. And it doesn't even bother to tell you what a Series#style config looks like except through examples. Examples that are wrong (I've entered bugs for that have been marked INFOREQ for some bizarre reason).
I'm not going to get mad, because this is still an RC. But I seriously hope these docs get a MAJOR update before release.
Thanks for the report! I have opened a bug in our bug tracker.