![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
We are using a Legend control (data provided by a Chart). When the use clicks
on an item in the legend, we need to capture this event. We are facing the current problems: 1. The text in the Legend control needs to be underlined. We have set the textDecoration="underline" as indicated by the API but the text is not underlined. 2. We want to show a hand cursor when the user hovers on the item. To do this we have set useHandCursor="true" mouseChildren="false" buttonMode="true" The problems are (a) If mouseChildren is set to false, we cannot capture the item click event. If its set to true, the hand cursor is shown on the background, not the item text. Please advise. |
| Sponsored Links |
|
|||
|
"kartikjayaraman" <webforumsuser@macromedia.com> wrote in message news:gd2mns$b48$1@forums.macromedia.com... > We are using a Legend control (data provided by a Chart). When the use > clicks > on an item in the legend, we need to capture this event. We are facing the > current problems: > > 1. The text in the Legend control needs to be underlined. We have set the > textDecoration="underline" as indicated by the API but the text is not > underlined. Could you post exactly what you tried? > 2. We want to show a hand cursor when the user hovers on the item. To do > this > we have set useHandCursor="true" mouseChildren="false" buttonMode="true" > The problems are (a) If mouseChildren is set to false, we cannot capture > the > item click event. If its set to true, the hand cursor is shown on the > background, not the item text. I think you'll need to subclass LegendItem to get this behavior. HTH; Amy |
|
|||
|
"kartikjayaraman" <webforumsuser@macromedia.com> wrote in message news:gd2uqp$kbb$1@forums.macromedia.com... > Thanks! > > Can you please give me a quick example on how I do that? > > I dont want to create Legend items as they are sourced by the chart. Here's an extended LegendItem I used to make the text wrap. You'd just override the constructor to set the mouseChildren, etc. properties package com.magnoliamultimedia.views { import flash.display.DisplayObject; import mx.charts.LegendItem; import mx.core.UITextField; public class WrappingLegendItem extends LegendItem { public function WrappingLegendItem() { super(); } override protected function createChildren():void{ super.createChildren(); for (var i:int=0;i<numChildren; i++){ var child isplayObject=getChildAt(i);var txt:UITextField = child as UITextField; if (!(txt==null)){ txt.wordWrap=true; txt.invalidateSize(); } } } } } It's used like this: <mx:Legend dataProvider="{subjectAllAttempts}" direction="horizontal" horizontalAlign="center" labelPlacement="bottom" verticalAlign="middle" legendItemClass="com.magnoliamultimedia.views.Wrap pingLegendItem" /> |
|
|||
|
"kartikjayaraman" <webforumsuser@macromedia.com> wrote in message news:gd314s$n0b$1@forums.macromedia.com... > Ok, I'll try that. What about the textDecoration property set to > underline. It doesn't show the text as underlined. Is this a Flex API bug > or am I doing something wrong? I don't know what you're doing, so I can't speculate about whether it is wrong or right. |
|
|||
|
[q]Originally posted by: Newsgroup User
"kartikjayaraman" <webforumsuser@macromedia.com> wrote in message news:gd314s$n0b$1@forums.macromedia.com... > Ok, I'll try that. What about the textDecoration property set to > underline. It doesn't show the text as underlined. Is this a Flex API bug > or am I doing something wrong? I don't know what you're doing, so I can't speculate about whether it is wrong or right. [/q] All I am doing is setting textDecoration="underline" - shouldnt the items be then underlined? <mx:Legend verticalGap="1" horizontalAlign="left" markerHeight="8" markerWidth="8" width="780" dataProvider="{MyDataProvider}" fontSize="10" id="ChartLegend" textDecoration="underline" height="70" x="10" y="337" useHandCursor="true" mouseChildren="false" buttonMode="true"> </mx:Legend> |
|
|||
|
"kartikjayaraman" <webforumsuser@macromedia.com> wrote in message news:gd33gk$pn1$1@forums.macromedia.com... > [q]Originally posted by: Newsgroup User > > "kartikjayaraman" <webforumsuser@macromedia.com> wrote in message > news:gd314s$n0b$1@forums.macromedia.com... > > Ok, I'll try that. What about the textDecoration property set to > > underline. It doesn't show the text as underlined. Is this a Flex API > > bug > > or am I doing something wrong? > > I don't know what you're doing, so I can't speculate about whether it is > wrong or right. > > > [/q] > > > All I am doing is setting textDecoration="underline" - shouldnt the items > be > then underlined? > > <mx:Legend verticalGap="1" horizontalAlign="left" markerHeight="8" > markerWidth="8" > width="780" dataProvider="{MyDataProvider}" > fontSize="10" id="ChartLegend" textDecoration="underline" > height="70" x="10" y="337" > useHandCursor="true" mouseChildren="false" buttonMode="true"> > </mx:Legend> Try: <mx:Style> LegendItem { textDecoration:underline; } </mx:Style> |
|
|||
|
Thansk Amy, however that does not work too. I have tried almost everything and
cant get the text in the Legend item to be underlined. Can you please try to add a Legend Control and see if it the textDecoration="underline" works for you? |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise