A really hacky way would be to store the current mouse X and Y
whenever the mouse moves anywhere on your Flex app, so when they click
on a item in your context menu, you will have the mouse X and Y and
can use the findDataPoints method on the chart to get the
ChartItem(s), and hence the dataprovider.

Odd that the right-click is so hard to capture and use though; I
thought it would've just have been a property on the MouseEvent.

2009/2/21 tungchau81 <[email protected]>:
> I am not writing things in AIR, therefore, I cannot rely on
> rightclick event.
>
> I assigned contextMenu of each PieSeries and ColumnSeries to my
> custom ContextMenu. Therefore, I was able to solve problem #1 as you
> said.
>
> When a user clicks on any item of my custom ContextMenu, I catch an
> event called ContextMenuEvent.MENU_ITEM_SELECT. However, this
> event.mouseTarget does not tell me the specific data of a
> dataprovider that belongs to the column or the pie wedge underneath
> the right mouse click.
>
> Any help is greatly appreciated,
> Tung Chau
>
> --- In [email protected], "sunild999999" <sunilbd...@...>
> wrote:
>>
>> --- In [email protected], "tungchau81" <tungchau81@> wrote:
>> >
>> >
>> > I have two problems:
>> > Problem#1:
>> > I know how to create right-click menu using ContextMenu and
>> > ContextMenuItem. However, I do not know how to make the right-
> click
>> > menu to show up **if and only if** a user clicks on a wedge of a
>> > PieChart or a column of a ColumnChart, not anywhere else.
>>
>> I did this with an AreaChart by adding an event listener for mouse
> clicks to each AreaSeries
>> object.  I imagine you could do the same thing with PieSeries or
> ColumnSeries.
>>
>> I'm not sure what to say about your second problem, I did the above
> in an AIR application :)
>>
>> Regards,
>> Sunil
>>
>
>
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>
>
>
>

Reply via email to