This version (0.1) of the DashedLineSeries component is an extension and implementation of the wonderful code posted on Quietly Scheming by Ely Greensfield. The component is an extension of a regular LineSeries except that it has a custom LineSeriesRenderer that draws a dashed line instead of a straight line.
Screen shot:
Code:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:visualization="net.srirangan.visualization.*">
<mx:Script><![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var expenses:ArrayCollection = new ArrayCollection([
{Month:"Jan", Profit:2000, Expenses:1500, Amount:450},
{Month:"Feb", Profit:1000, Expenses:200, Amount:600},
{Month:"Mar", Profit:1500, Expenses:500, Amount:300}
]);]]></mx:Script>
<mx:Panel title="Line Chart With Strokes">
<mx:LineChart id="myChart" dataProvider="{expenses}" showDataTips="true" seriesFilters="{new Array}">
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{expenses}" categoryField="Month"/>
</mx:horizontalAxis>
<mx:series>
<visualization:DashedLineSeries yField="Profit" displayName="Profit"/>
<mx:LineSeries yField="Expenses" displayName="Expenses"/>
<mx:LineSeries yField="Amount" displayName="Amount"/>
</mx:series>
</mx:LineChart>
<mx:Legend dataProvider="{myChart}" direction="horizontal"/>
</mx:Panel>
</mx:Application>
What’s next?
– Pre defined multiple line patterns
– User defined line patterns
