Created
February 23, 2011 16:11
-
-
Save rockydd/840621 to your computer and use it in GitHub Desktop.
Chart Sample; columnchart, vertical axis label function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<fx:Script> | |
<![CDATA[ | |
private function labelPhaseEffortVertical(labelValue:Object, previousLabelValue:Object, axis:AxisBase):String | |
{ | |
return labelValue + "Hrs"; | |
} | |
]]> | |
</fx:Script> | |
<fx:Style> | |
@namespace s "library://ns.adobe.com/flex/spark"; | |
@namespace mx "library://ns.adobe.com/flex/mx"; | |
.pieLabel { font-weight: bold } | |
.chartCoffee { | |
fills:#A2825C,#8E5B3E,#B08D53,#BEA586,#674941,#FCFBE3; | |
} | |
.columnCoffee { | |
chartSeriesStyles: coffee1,coffee2,coffee3,coffee4,cooffee5; | |
} | |
.coffee1{ | |
fill:#A2825c; | |
} | |
.coffee2{ | |
fill:#8E5B3E; | |
} | |
.coffee3{ | |
fill:#B08D53; | |
} | |
.coffee4{ | |
fill:#BEA586; | |
} | |
.coffee5{ | |
fill:#674941; | |
} | |
</fx:Style> | |
<mx:PieChart width="280" height="280" id="pieTeamEffortPersonDev" dataProvider="{subProject}" showDataTips="true" > | |
<mx:series> | |
<mx:PieSeries displayName="Effort" field="@data" nameField="@label" | |
labelPosition="inside" labelFunction="displayTeamEfforLabel" styleName="chartCoffee" > | |
<mx:showDataEffect> | |
<mx:SeriesInterpolate duration="1000"/> | |
</mx:showDataEffect> | |
</mx:PieSeries> | |
</mx:series> | |
</mx:PieChart> | |
<mx:ColumnChart id="myChart" width="800" dataProvider="{phaseEffort}" showDataTips="true" styleName="columnCoffee"> | |
<mx:horizontalAxis> | |
<mx:CategoryAxis categoryField="project"/> | |
</mx:horizontalAxis> | |
<mx:verticalAxis> | |
<mx:LinearAxis labelFunction="labelPhaseEffortVertical"/> | |
<!-- <mx:CategoryAxis labelFunction="labelPhaseEffortVertical"/> --> | |
</mx:verticalAxis> | |
<mx:series> | |
<mx:ColumnSeries | |
xField="project" | |
yField="design" | |
displayName="Design" | |
> | |
<mx:showDataEffect> | |
<mx:SeriesInterpolate duration="1000"/> | |
</mx:showDataEffect> | |
</mx:ColumnSeries> | |
<mx:ColumnSeries | |
xField="project" | |
yField="coding" | |
displayName="Coding" > | |
<mx:showDataEffect> | |
<mx:SeriesInterpolate duration="1000"/> | |
</mx:showDataEffect> | |
</mx:ColumnSeries> | |
<mx:ColumnSeries | |
xField="project" | |
yField="test" | |
displayName="Test"> | |
<mx:showDataEffect> | |
<mx:SeriesInterpolate duration="1000"/> | |
</mx:showDataEffect> | |
</mx:ColumnSeries> | |
<mx:ColumnSeries | |
xField="project" | |
yField="review" | |
displayName="Review"> | |
<mx:showDataEffect> | |
<mx:SeriesInterpolate duration="1000"/> | |
</mx:showDataEffect> | |
</mx:ColumnSeries> | |
</mx:series> | |
</mx:ColumnChart> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment