Saturday, April 26, 2008

Flex profiler

Hey people if you think your Flex application is hogging memory .. then Profiler is something you people should have a look at . SRp has prepared a PPT to explain the features of "Flex profiler" .

Tree chart for Flex

Nancy had asked for a sample on TreeChart . Here is a quick component I built for
Nancy . Ofcourse you can customise colours .. Sorrry I think my colour combinations are bad

You can download the source here
Usage :
1> Tree chart takes Hierarchical data as input .
2> Every node should have Name(Level as used in example[ It gets displayed in the chart] ) and value ( per in the example [ its the percentage]) and color ( the color of the area)
3> labelName should be mapped to Name and perName should be mapped to value

Look at the sample named testChart from the downloaded source .
Thank You Nancy for bringing up a good requirement :)

Wednesday, April 16, 2008


Hi people there is some confusion created about the swc . So here is the swc which I now is definitely working . . .
I ll detail the procedure of how to build your swc in the flexbuilder soon in the next post .

PopUpButton sometimes have to be clicked twice to open .

Hi guys ,
Sometimes you will encounter a situation when you will have to click your popupButton twice .
So to overcome this behaviour

replace the following code in the sdk's PopUpButton code

private function removeFromStageHandler(event:Event):void
_popUp = null

private function removeFromStageHandler(event:Event):void
_popUp = null

All i have done is check if the Popup is showing up before setting to null .
If the popup is not showing up then dont set the _popUp to null ;

Tuesday, April 15, 2008

How to use the PivotComponent

If you want to provide "pivot Table" functionalities to ur application .. Just download the swc
from this post of mine .

You can see through the installation and samples there in the source , But just to give u a picture of how easy it is to use , say You have gotta do is

<fc:PivotComponent dataProvider="{flatData}" width="100%" height="100%">
<fc:DimensionList dataProvider="{flatData}" height="100%" width="100%"
color= "0xFFFFFF" alternatingItemColors="[0x000000,0x000000]"/>
<fc:MeasuresList dataProvider="{['Sales', 'Production', 'Cost']}" height="100%"
width="100%" id="m1" color= "0xFFFFFF" />
<fc:OLAPChartExtension height="100%" width="100%" measuresList="{m1}">
type="Column" showDataTips="true"/>
<fc:OLAPDataGridExtension width="100%" height="100%"/>

Isnt it easy ?? Hey I have skipped the Layouting for displaying simplicity [ Use HBoxes and VBoxes to layout ]

[I think I have to come up with a component to poste codes .. Any suggestions .. please do give]

Performing Drilldown/up in charts

Sreenivas Had developed a sample which shows how to drill down and up in charts effectively .
If you are looking for a drilldown/up chart visit this blog

Monday, April 7, 2008

Here is much awaited PivotComponent in Flex

Well here is a implementation of Excels pivotComponent . I have used the OLAPDataGrid and OLAP API's of flex 3.0 .

For better experience click here

You are seeing
  • Dimensions List ==> left corner where "company " etc are shown
  • Measures List ==> Below the dimension's list . You can choose "Sum" , "Avg" etc
  • TabNavigator which shows "Chart View " and "grid View"
  • You can drag any dimension and drop it on to the Grid's or Charts row/column/slicer axis [ Grid n Chart will Prompt its acceptance]
  • You ca perform filtering by opening the popup button and unselecting what u dont need
  • You can perform slicing similarly
Source can be found here

Friday, March 14, 2008

Adding a drop-down button to the OlapDatagrid header

Flex give u the liberty to have different renderers . Well first lets understand how things work ..

  • Place PopUpButton [ PivotPopUpButton] as a headerRenderer for OlapDataGrid
  • When the dropdown is selected the dropdown list provides a list of members of the attribute

OlapDataGrid extends form AdvancedDataGrid.
OlapDataGrid when creating headers , will call makelistdata for each header .
Now if u wish to pass some information apart from already available info u need to create a class that extends AdvancedDataGridListData.

For example in our scenario we need a popUpButton which shows members when a dropdown button is pressed . So the information of members should be passed on to the PopUpButton . So what we do is we create a class PivotListData that extends the AdvancedDataGridListData and add two properties namely
  • hasMembers : Boolean
  • members : ArrayCollection
Now we override makelistData of OlapDataGrid so that it returns PivotListData . So that olapDataGrid gives PivotListData to the renderers . In the renderer's set listdata , you have all the info needed . You can find the source code here

When you click the dropdown button of Company , you can see the choices .( Some problem with popup button coz of which u need to click the button twice ).

[PS : that I havent added the code for filtering here .. Soon I ll post a pivot Component in Flex ]