Assign Value to <mx:LineSeries To Get In override public function set data

3 views
Skip to first unread message

flexkwt

unread,
Sep 24, 2008, 10:31:20 PM9/24/08
to Flex India Community
Hello,

Is it possible to assign a value to a <mx:LineSeries like we do for
<mx:DataGridColumn dataField="Test"

The idea is when I override override public function set data, I want
to get a value from <mx:LineSeries so that I could use that
in the override function
super.data = value;
Alert.show(data. Test);

How can I achieve this?

Thanks

flexkwt

unread,
Sep 25, 2008, 3:09:58 AM9/25/08
to Flex India Community
some could help?
I am not sure whether this is the correct approach.

Thanks

GnanaPrakasam T

unread,
Sep 25, 2008, 4:11:29 AM9/25/08
to flex_...@googlegroups.com
Using xfield and yfirld attributes in Lineseries You can set the datafield values to Lineseries.

 
i preassume that the word 'Test' you are using here is one field in Arraycollection.

<mx:LineSeries
     
    xField="Test"
    yField="Some_other_field_value"

if it is not what you are intended,can you provide more details about your problem in other words,
without 
super.data = value;

and all.

Because your problem may some other easy solution.



Gnanz,,,/

flexkwt

unread,
Sep 25, 2008, 4:18:08 AM9/25/08
to Flex India Community
Hello,

I cannot set the Test value in xfield because xfield contains other
information to be displayed.
What in the Test variable contains is the value which I require to
check what kind of chartRenderer I need to display whether
TriangleItemRenderer or CircleItemRenderer

In <mx:DataGridColumn we could set dataField="Test" and
in the
override public function set data
I could get the Test value as
Alert.show(value.Test);

So I am looking for something very similar approach to check the value
in Test.

Thanks and regards

flexkwt

unread,
Sep 25, 2008, 8:39:40 AM9/25/08
to Flex India Community
Someone could please help

Regards

imtiyaz

unread,
Sep 25, 2008, 9:42:49 AM9/25/08
to Flex India Community
Okey If I consider your object like

CustomObject
-xFieldValue
-yFieldValue
-extraVal1
-extraVal2
....

if your data provider is having a collection of CustomObjects. what is
the problem here ?

you renderer can get the complete object and you can fetch the other
values from it.
May I think the problem is with the structure of data you are having.

if I am wrong please come up with a clear explanation.

Regards,
Imtiyaz Basha

flexkwt

unread,
Sep 25, 2008, 10:50:17 AM9/25/08
to Flex India Community
Hi,
Thanks a lot for the answer.

My dataprovider is in fact a collection. And Test is added as addItem
to the collection.
But inside the renderer, I am not sure how to get the value from Test.

In the In <mx:DataGridColumn we could set dataField="Test" and can get
the value by overriding the set data function.
Since <mx:LineSeries doesn't have dataField, I am not sure how to get
the value.

xField and yField I am using to display other values.
Is there a way to get the complete values in renderer?
How can I do this?

Thanks again.
Message has been deleted

imtiyaz

unread,
Sep 25, 2008, 11:15:54 AM9/25/08
to Flex India Community
At this point I didn't felt any difference in your question and your
explanation.
I suggest you to go through Line Series api and examples.

http://livedocs.adobe.com/flex/2/langref/mx/charts/series/LineSeries.html
I bet it will clear all your doubts,

Regards,
Imtiyaz Basha M S

flexkwt

unread,
Sep 25, 2008, 9:02:55 PM9/25/08
to Flex India Community
Sorry about the confusion.

What I would like to do is
I need to verify a value which is in a Array Collection(I am adding
value to Test as AddItem)
and based on the value in Test, show Triangle or Circle ItemRenderer.

Regards

On Sep 25, 11:15 pm, imtiyaz <imtiyaz...@gmail.com> wrote:
> At this point I didn't felt any difference in your question and your
> explanation.
> I suggest you to go through Line Series api and examples.
>
> http://livedocs.adobe.com/flex/2/langref/mx/charts/series/LineSeries....

imtiyaz

unread,
Sep 28, 2008, 1:25:23 PM9/28/08
to Flex India Community
Ok,
So your problem is dynamic rendering of DATA :)
override the updataDisplayList in your renderer check the data
property if choice1 draw traingle else draw cirlce ...
Point here is instead of using TraingleItemRenderer or
CircleItemRenderer you need to write the custom rendering component
here.

Which fulfills your purposes.

Regards,
Imtiyaz Basha M S


flexkwt

unread,
Sep 28, 2008, 6:05:51 PM9/28/08
to Flex India Community
Could you kindly provide a small example for this as how to call the
function to get the value inside the updataDisplayList ?

Thanks
Reply all
Reply to author
Forward
0 new messages