Hello,
I'm re-posting this because I am pretty sure it is a bug, and I was
hoping one of the Flex engineers could confirm that it has been noted
(if not tested).
I'm getting really sporatic responses from a listener to the
ChartMouseEvent.MOUSE_OVER_DATA
By "sporatic" I mean that the events only fire if the mouse is going
one direction (left to right on the non-stacked one I believe)
and the event doesn't fire at all when entering a chart item from one
side or the other; Only when crossing from one item to another.
Note it wasn't this way in the alpha. Only significant differences on
my part is the use of XMLListCollecitons as data providers.
see the sample app below. It should reproduce the defect.
Thanks,
Thunder
_______________________
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
width="100%" height="100%"
xmlns:mx="http://www.macromedia.com/2005/mxml"
xmlns:root="*">
<mx:ColumnChart id="mainChart" width="403" height="232" />
<mx:Button label="Fetch" click="populateStaticChart()"/>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.collections.XMLListCollection;
import mx.charts.series.ColumnSeries;
import mx.charts.CategoryAxis;
import mx.charts.events.ChartMouseEvent;
public function populateStaticChart():void
{
var oData:XMLList = null;
var oXML:XML =
<data>
<row>
<Year>2005</Year>
<PageConvergenceMSMUnits>6.654</PageConvergenceMSMUnits>
<PageMultimediaMSMUnits>4.3</PageMultimediaMSMUnits>
<PageEnhancedMSMUnits>4.972</PageEnhancedMSMUnits>
<PageValueMSMUnits>6.117</PageValueMSMUnits>
</row>
</data>;
oData = oXML.row;
var oXMLCol:XMLListCollection = new XMLListCollection(oData);
var aYears:Array = [ "2005" ];
var aTypes:Array = [ "Enhanced", "Convergence", "Multimedia",
"Value" ];
// mainChart.type = "stacked";
mainChart.addEventListener(ChartMouseEvent.MOUSE_OVER_DATA,
hoverChartData);
// add the category axis to the chart
var hAxis:CategoryAxis = new CategoryAxis();
// this works! Thanks!
hAxis.categoryField = "" ;
hAxis.dataProvider = aYears;
hAxis.name = "Year" ;
mainChart.horizontalAxis = hAxis;
// add the series to the chart
var sa:Array = mainChart.series
for each (var sName:String in aTypes)
{
var cSeries:ColumnSeries = new ColumnSeries();
cSeries.yField = "Page" + sName + "MSMUnits" ;
cSeries.name = sName;
cSeries.dataProvider = oXMLCol;
sa.push( cSeries );
}
mainChart.series = sa;
}
public function hoverChartData(event:ChartMouseEvent):void
{
var oItem:Object = null;
oItem = event.hitData.item;
log.text += "\n" + event.hitData.element.name;
}
]]>
</mx:Script>
</mx:Application>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/