on 11-16-2010 7:45 PM
I'm playing around with displaying data from WDA as charts in Flex 3.
I'm able to bind my internal table, which has 3 fields, to the plot chart.
The table looks like this
ext_id type string " bound to prjname in Flex
cost type string " bound to prjcost in Flex
benefit type string " bound to prjbenefit in Flex
These are all bound to my island's DataSource.
I have bound these in Flex and the Cost and Benefits are showing up as points on my chart. However, I can't seem to get the Project Name to display on the plot points. All I see when I mouse over the point is EXT_ID, and the values for cost and benefits.
The cost/benefit values are coming across correctly, just not the project name (ext_id) value. any ideas?
here's the Flex code for the chart
[Bindable]
public var dataSource:ArrayCollection;
[Bindable]
public var prjcost:String;
[Bindable]
public var prjbenefit:String;
[Bindable]
public var prjname:String;.
.
.
<mx:PlotChart id="plotchart1" dataProvider="{dataSource}" showDataTips="true">
<mx:series>
<mx:PlotSeries displayName="{prjname}" yField="{prjcost}" xField="{prjbenefit}" dataProvider="/>
</mx:series>
</mx:PlotChart>
This is because your public bindable variables prjcost, prjbenefit, and prjname literally are just holding the attribute name of the context that dataSource is bound to. This works for yField and xField because those properites of the PlotSeries expect an attribute name relative to the parent dataProvider. However the displayName property is different. It doesn't assume the value is relative to the dataProvider.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for the explanation...
so the next logical question is whether it's possible to feed in the project name (ext_id value) and populate the displayName of the plot point with that value?
Could I feed the project name into some sort of array and then assign that value to the displayName?
off topic... several of our team went to Teched and really enjoyed your NW 7.00 -> 7.01 ->7.02 deltas presentation... we just installed 7.01 (7.02 will be at the end of the month when released) on our xRPM system and I have been eager to get my hands on some of the new technical capabilities.
This is really a Flex question not an Islands specific one. I don't think the displayName properity is what you want to use here. This is the name for the entire series as it will be displayed in the legend. I think what you want is a dataTip. You register a callback for the dataTip rendering and then fill the custom dataTip quick info.
This is an example from a bar chart, but the theory is the same:
<mx:BarChart id="barChart" dataTipFunction="dtFunc" xmlns:mx="http://www.adobe.com/2006/mxml" type="clustered" width="100%" showDataTips="true" height="100%">
<mx:verticalAxis>
<mx:CategoryAxis categoryField="{SalesOrd}" dataProvider="{dataSource}" />
</mx:verticalAxis>
<mx:series>
<mx:BarSeries id="bsGross" xField="{grossAmt}" displayName="Gross Amount" dataProvider="{dataSource}" fill="{otdFill}" showDataEffect="{slideIn}" />
<mx:BarSeries id="bsNet" xField="{netAmt}" displayName="Net Amount" dataProvider="{dataSource}" fill="{rtyFill}" showDataEffect="{zoomIn}" />
</mx:series>
</mx:BarChart>
private function dtFunc(hd:HitData):String {
switch(BarSeries(hd.element).id){
case "bsGross":
return "Sales Order #: " + hd.item.SO_ID + "\n" + FlashIsland.formatNumber(hd.item.TTL_GROSS_AMOUNT) + " " + hd.item.CURRENCY_CODE;
break;
case "bsNet":
return "Sales Order #: " + hd.item.SO_ID + "\n " + FlashIsland.formatNumber(hd.item.TTL_NET_AMOUNT) + " " + hd.item.CURRENCY_CODE;
break;
}
return "Amount";
}
I should also point out that the value I am seeing as the plot point label is "EXT_ID".
it seems like the WDA fieldname is being used instead of the value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.