views:

509

answers:

2

I have a linechart and dots showing the places where a datatip pops up. I can change the line to any color I want and I can set the inside color of the dot. But the border color still stays orange (from the default color). Someone knows how I can set this property easy?

this is the code:

<mx:LineSeries id="dayEnergieLineSeries" 
     yField="number"
     showDataEffect="{slideIn}" hideDataEffect="{slideOut}">
     <mx:lineStroke>
      <mx:Stroke color="#d3ce01" />
     </mx:lineStroke>
     <mx:itemRenderer>

                        <mx:Component>
                         <mx:CircleItemRenderer />
                        </mx:Component>
              </mx:itemRenderer>
    </mx:LineSeries>
A: 

From the docs:

It renders its area on screen using the fill and stroke styles of its associated series.

So you'll have to assign a stroke to the dayEnergieLineSeries series.

[Bindable] private var _stroke:Stroke = new Stroke(...);

<mx:LineSeries id="dayEnergieLineSeries" stroke="{_stroke}"/>

or if you don't need the data binding, just set it as a style.

PS: There is a good chart explorer available here: http://demo.quietlyscheming.com/ChartSampler/app.html

Christophe Herreman
The problem isn't to add a line to the LineSeries and the line already has the right color. But the data points that are on the line have the wrong color. I want them to be the same color as the line
Arno
The CircleItemRenderer uses the stroke of the series to draw itself, so you'll need to set a stroke on the series. This will not only affect your linestroke, but also the data point stroke. Check the sources (right click) of the link I posted. There are some helpful code examples there.
Christophe Herreman
Well that example isn't using datatips and isn't using the dots where i'm talking about. But I now have it working so thanks for pointing me in the right direction!
Arno
A: 

Assigning color for stroke does not change the color for CircleItemRenderer. Anyone has a solution?

Saket Jha
If you first create the stroke: [Bindable]public var stroke1:Stroke = new Stroke(0xcfcf00, 3);and then assign him to a LineSeries. That should give the circleitemrenderer the right color.
Arno