Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Adobe Flex SDK Previous
-
None
-
None
-
Affected OS(s): Windows
Affected OS(s): Windows XP
Language Found: English
Description
Steps to reproduce:
1. create a Plot or line chart without itemRenderers (null - no cross or points, dimonds, ...)
2. set the lineStroke style to a SolidColorStroke instead of a deprecated Stroke
3. add the legend and some data and run
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" initialize="initApp(event)">
<fx:Declarations>
<s:SolidColorStroke id="lineStroke" color="0xffaaaa" alpha="0.9" weight="1" />
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var dailyDP:ArrayCollection = new ArrayCollection();
private function initApp(e:Event):void
{
//-- init with debug random data
var i:uint;
// – DAILY
for ( i = 0;i<30;i++)//370
{
var nextDate:Date = new Date(1970, i, 1, 0, 0, 0, 0);
dailyDP.addItem(
);
}
}
]]
>
</fx:Script>
<mx:LineChart x="88" y="44" id="plotchart1" dataProvider="
">
<mx:series>
<mx:LineSeries displayName="Profit" xField="date" yField="Profit" itemRenderer="
" lineStroke="
{lineStroke}"/>
</mx:series>
<mx:seriesFilters />
<mx:filters />
<mx:horizontalAxis>
<mx:DateTimeAxis dataUnits="days" interval="1" />
</mx:horizontalAxis>
<mx:verticalAxis>
<mx:LinearAxis />
</mx:verticalAxis>
</mx:LineChart>
<mx:Legend dataProvider="
"/>
</s:Application>
Actual Results:
The legend markers are always black
Expected Results:
They should be of the color defined for the lineSeries
Workaround (if any):
Override the private LineSeriesLegendMarker in LineSeries or set your own legend marker class
Solution:
add a test case in the LineSeriesLegendMarker for SolidColorStroke
if (fillStroke is SolidColorStroke)
else if (fillStroke is Stroke)
{ color = Stroke(fillStroke).color; }else if (fillStroke is LinearGradientStroke)
{ var gb:LinearGradientStroke = LinearGradientStroke(fillStroke); if (gb.entries.length > 0) color = gb.entries[0].color; }