flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From V Chandrasekhar <shake...@yahoo.com.INVALID>
Subject Area Chart: How to Specify a "Base" for a Semilog Plot?
Date Tue, 01 Jul 2014 14:34:31 GMT
I have copied below the code for a semi log plot. (This has been adapted from one of the examples
in the Adobe Flex documentation.) The y-axis is the log axis.

The fills are done with respect to y = 1. Is there a way to get the fills done with respect
to y = 0.1?
 
<?xml version="1.0"?>
<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">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var expensesAC:ArrayCollection = new ArrayCollection( [
{ Month: "Jan", Profit: 2000, Expenses: 1500, Amount: 0.5 },
{ Month: "Feb", Profit: 1000, Expenses: 200, Amount: 5 },
{ Month: "Mar", Profit: 1500, Expenses: 500, Amount: 0.1 },
{ Month: "Apr", Profit: 1800, Expenses: 1200, Amount: 5 },
{ Month: "May", Profit: 2400, Expenses: 575, Amount: 1 } ]);
]]>
</fx:Script>
<fx:Declarations>
<!-- Define custom colors for use as fills in the AreaChart control. -->
<mx:SolidColor id="sc1" color="blue" alpha=".3"/>
<mx:SolidColor id="sc2" color="red" alpha=".3"/>
<mx:SolidColor id="sc3" color="green" alpha=".3"/>
<!-- Define custom Strokes. -->
<mx:SolidColorStroke id = "s1" color="blue" weight="2"/>
<mx:SolidColorStroke id = "s2" color="red" weight="2"/>
<mx:SolidColorStroke id = "s3" color="green" weight="2"/>
</fx:Declarations>
<mx:Panel height="100%" width="100%" layout="horizontal">
<mx:AreaChart id="Areachart" height="100%" width="45%"
  paddingLeft="5" paddingRight="5" 
  showDataTips="true" dataProvider="{expensesAC}">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="Month"/>
</mx:horizontalAxis>
<mx:verticalAxis>
<mx:LogAxis />
</mx:verticalAxis>
<mx:series>
<mx:AreaSeries yField="Amount" form="curve" displayName="Amount" areaStroke="{s3}" areaFill="{sc3}"
/>
</mx:series>
</mx:AreaChart>
<mx:Legend dataProvider="{Areachart}"/>
</mx:Panel>
</s:Application>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message