You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by V Chandrasekhar <sh...@yahoo.com.INVALID> on 2014/07/01 16:34:31 UTC

Area Chart: How to Specify a "Base" for a Semilog Plot?

I have copied below the code for a semi log plot. (This has been adapted from one of the examples in the Adobe Flex documentation.) The y-axis is the log axis.

The fills are done with respect to y = 1. Is there a way to get the fills done with respect to y = 0.1?
 
<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   xmlns:s="library://ns.adobe.com/flex/spark" 
   xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var expensesAC:ArrayCollection = new ArrayCollection( [
{ Month: "Jan", Profit: 2000, Expenses: 1500, Amount: 0.5 },
{ Month: "Feb", Profit: 1000, Expenses: 200, Amount: 5 },
{ Month: "Mar", Profit: 1500, Expenses: 500, Amount: 0.1 },
{ Month: "Apr", Profit: 1800, Expenses: 1200, Amount: 5 },
{ Month: "May", Profit: 2400, Expenses: 575, Amount: 1 } ]);
]]>
</fx:Script>
<fx:Declarations>
<!-- Define custom colors for use as fills in the AreaChart control. -->
<mx:SolidColor id="sc1" color="blue" alpha=".3"/>
<mx:SolidColor id="sc2" color="red" alpha=".3"/>
<mx:SolidColor id="sc3" color="green" alpha=".3"/>
<!-- Define custom Strokes. -->
<mx:SolidColorStroke id = "s1" color="blue" weight="2"/>
<mx:SolidColorStroke id = "s2" color="red" weight="2"/>
<mx:SolidColorStroke id = "s3" color="green" weight="2"/>
</fx:Declarations>
<mx:Panel height="100%" width="100%" layout="horizontal">
<mx:AreaChart id="Areachart" height="100%" width="45%"
  paddingLeft="5" paddingRight="5" 
  showDataTips="true" dataProvider="{expensesAC}">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="Month"/>
</mx:horizontalAxis>
<mx:verticalAxis>
<mx:LogAxis />
</mx:verticalAxis>
<mx:series>
<mx:AreaSeries yField="Amount" form="curve" displayName="Amount" areaStroke="{s3}" areaFill="{sc3}" />
</mx:series>
</mx:AreaChart>
<mx:Legend dataProvider="{Areachart}"/>
</mx:Panel>
</s:Application>

Re: Area Chart: How to Specify a "Base" for a Semilog Plot?

Posted by OmPrakash Muppirala <bi...@gmail.com>.
Any chance you could draw a diagram showing how you want the chart to look
like?  I am having a hard time understanding.  If someone else gets it,
perhaps they can respond?

P.S. You can use an online image editing tool like: https://onpaste.com/ to
draw your requirements.

Thanks,
Om


On Tue, Jul 15, 2014 at 11:13 AM, shaker <sh...@yahoo.com> wrote:

> Thanks for the reply.
>
> I got the same graph as you did. This is NOT what I want. It uses y=1 as
> the "base". I want y = 0.1 as the base. In other words, areas above 0.1
> must be filled. In the picture you sent,
>
> . the area to the left of the rising line should NOT be filled.
>
> . the area to the right of that line must be filled from y=0.1. Right now,
> only the part above y=1 is filled.
>
> . The next area should not be filled.
>
> . The rightmost area should be filled all the way to y=0.1 if possible.
>
>  It may be easier to see things with form="step".
>
> y = 1 is not a special line. y = 0.1 (which is practically the x axis) is.
> All areas above it must be shaded. [y=1 is a special line for the log plot
> since log 1 = 0. However, I want areas above the real 0 to be shaded.]
>
> Thanks again.
>
> Your reply went to my Spam folder. I seldom check here for good messages.
>
>
> ________________________________
>  From: OmPrakash Muppirala [via Apache Flex Users] <
> ml-node+s2333346n7279h30@n4.nabble.com>
> To: shaker <sh...@yahoo.com>
> Sent: Tuesday, July 15, 2014 1:58 PM
> Subject: Re: Area Chart: How to Specify a "Base" for a Semilog Plot?
>
>
>
> This is what I am seeing: http://i.imgur.com/xPTHgM7.png
>
> If I understand you correct, this does look like what you want, right?
>
> Thanks,
> Om
>
>
> On Tue, Jul 1, 2014 at 7:44 AM, shaker <[hidden email]> wrote:
>
>
> > > The fills are done with respect to y = 1. Is there a way to get the
> fills
> > done with respect to y = 0.1?
> >
> > In case the above is not clear, if you copy the code and run, what I am
> > asking will be clear -- I want the areas above the y = 0.1 horizontal
> line
> > to be shaded. Currently, by default y = 1 is taken as the "base" and
> areas
> > above and below are filled. I want y = 0.1 to be the base.
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7113.html
> > Sent from the Apache Flex Users mailing list archive at Nabble.com.
> >
>
>
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7279.html
> To unsubscribe from Area Chart:  How to Specify a "Base" for a Semilog
> Plot?, click here.
> NAML
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7281.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Area Chart: How to Specify a "Base" for a Semilog Plot?

Posted by shaker <sh...@yahoo.com>.
Thanks for the reply.

I got the same graph as you did. This is NOT what I want. It uses y=1 as the "base". I want y = 0.1 as the base. In other words, areas above 0.1 must be filled. In the picture you sent,

. the area to the left of the rising line should NOT be filled. 

. the area to the right of that line must be filled from y=0.1. Right now, only the part above y=1 is filled. 

. The next area should not be filled.

. The rightmost area should be filled all the way to y=0.1 if possible. 

 It may be easier to see things with form="step".

y = 1 is not a special line. y = 0.1 (which is practically the x axis) is. All areas above it must be shaded. [y=1 is a special line for the log plot since log 1 = 0. However, I want areas above the real 0 to be shaded.]

Thanks again.

Your reply went to my Spam folder. I seldom check here for good messages.


________________________________
 From: OmPrakash Muppirala [via Apache Flex Users] <ml...@n4.nabble.com>
To: shaker <sh...@yahoo.com> 
Sent: Tuesday, July 15, 2014 1:58 PM
Subject: Re: Area Chart: How to Specify a "Base" for a Semilog Plot?
 


This is what I am seeing: http://i.imgur.com/xPTHgM7.png

If I understand you correct, this does look like what you want, right? 

Thanks, 
Om 


On Tue, Jul 1, 2014 at 7:44 AM, shaker <[hidden email]> wrote: 


> > The fills are done with respect to y = 1. Is there a way to get the fills 
> done with respect to y = 0.1? 
> 
> In case the above is not clear, if you copy the code and run, what I am 
> asking will be clear -- I want the areas above the y = 0.1 horizontal line 
> to be shaded. Currently, by default y = 1 is taken as the "base" and areas 
> above and below are filled. I want y = 0.1 to be the base. 
> 
> 
> 
> -- 
> View this message in context: 
> http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7113.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com. 
> 


________________________________
 
If you reply to this email, your message will be added to the discussion below:http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7279.html 
To unsubscribe from Area Chart:  How to Specify a "Base" for a Semilog Plot?, click here.
NAML



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7281.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Area Chart: How to Specify a "Base" for a Semilog Plot?

Posted by shaker <sh...@yahoo.com>.
In the attached image, I have areas the parts that should not be there and added the areas that should be there. [Sorry it looks like something a child draws :-)]


________________________________
 From: OmPrakash Muppirala [via Apache Flex Users] <ml...@n4.nabble.com>
To: shaker <sh...@yahoo.com> 
Sent: Tuesday, July 15, 2014 2:29 PM
Subject: Re: Area Chart: How to Specify a "Base" for a Semilog Plot?
 


Ah, I get it now.  Sorry for being dense :-)  I will try a couple of things 
to see if that is possible, when I get a chance. 

Thanks, 
Om 


On Tue, Jul 15, 2014 at 11:25 AM, shaker <[hidden email]> wrote: 


> In simple terms, areas between the function being drawn (i.e., the thick 
> green curved line) and y = 0.1 should be shaded. 
> 
> What it currently does is to shade areas between the function being drawn 
> and y = 1. 
> 
> 
> 
> 
> ________________________________ 
>  From: OmPrakash Muppirala [via Apache Flex Users] < 
> [hidden email]> 
> To: shaker <[hidden email]> 
> Sent: Tuesday, July 15, 2014 1:58 PM 
> Subject: Re: Area Chart: How to Specify a "Base" for a Semilog Plot? 
> 
> 
> 
> This is what I am seeing: http://i.imgur.com/xPTHgM7.png
> 
> If I understand you correct, this does look like what you want, right? 
> 
> Thanks, 
> Om 
> 
> 
> On Tue, Jul 1, 2014 at 7:44 AM, shaker <[hidden email]> wrote: 
> 
> 
> > > The fills are done with respect to y = 1. Is there a way to get the 
> fills 
> > done with respect to y = 0.1? 
> > 
> > In case the above is not clear, if you copy the code and run, what I am 
> > asking will be clear -- I want the areas above the y = 0.1 horizontal 
> line 
> > to be shaded. Currently, by default y = 1 is taken as the "base" and 
> areas 
> > above and below are filled. I want y = 0.1 to be the base. 
> > 
> > 
> > 
> > -- 
> > View this message in context: 
> > 
> http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7113.html
> > Sent from the Apache Flex Users mailing list archive at Nabble.com. 
> > 
> 
> 
> ________________________________ 
> 
> If you reply to this email, your message will be added to the discussion 
> below: 
> http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7279.html
> To unsubscribe from Area Chart:  How to Specify a "Base" for a Semilog 
> Plot?, click here. 
> NAML 
> 
> 
> 
> -- 
> View this message in context: 
> http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7283.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com. 
> 


________________________________
 
If you reply to this email, your message will be added to the discussion below:http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7284.html 
To unsubscribe from Area Chart:  How to Specify a "Base" for a Semilog Plot?, click here.
NAML

modified_graph.png (375K) <http://apache-flex-users.2333346.n4.nabble.com/attachment/7285/0/modified_graph.png>




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7285.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Area Chart: How to Specify a "Base" for a Semilog Plot?

Posted by OmPrakash Muppirala <bi...@gmail.com>.
Ah, I get it now.  Sorry for being dense :-)  I will try a couple of things
to see if that is possible, when I get a chance.

Thanks,
Om


On Tue, Jul 15, 2014 at 11:25 AM, shaker <sh...@yahoo.com> wrote:

> In simple terms, areas between the function being drawn (i.e., the thick
> green curved line) and y = 0.1 should be shaded.
>
> What it currently does is to shade areas between the function being drawn
> and y = 1.
>
>
>
>
> ________________________________
>  From: OmPrakash Muppirala [via Apache Flex Users] <
> ml-node+s2333346n7279h30@n4.nabble.com>
> To: shaker <sh...@yahoo.com>
> Sent: Tuesday, July 15, 2014 1:58 PM
> Subject: Re: Area Chart: How to Specify a "Base" for a Semilog Plot?
>
>
>
> This is what I am seeing: http://i.imgur.com/xPTHgM7.png
>
> If I understand you correct, this does look like what you want, right?
>
> Thanks,
> Om
>
>
> On Tue, Jul 1, 2014 at 7:44 AM, shaker <[hidden email]> wrote:
>
>
> > > The fills are done with respect to y = 1. Is there a way to get the
> fills
> > done with respect to y = 0.1?
> >
> > In case the above is not clear, if you copy the code and run, what I am
> > asking will be clear -- I want the areas above the y = 0.1 horizontal
> line
> > to be shaded. Currently, by default y = 1 is taken as the "base" and
> areas
> > above and below are filled. I want y = 0.1 to be the base.
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7113.html
> > Sent from the Apache Flex Users mailing list archive at Nabble.com.
> >
>
>
> ________________________________
>
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7279.html
> To unsubscribe from Area Chart:  How to Specify a "Base" for a Semilog
> Plot?, click here.
> NAML
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7283.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Area Chart: How to Specify a "Base" for a Semilog Plot?

Posted by shaker <sh...@yahoo.com>.
In simple terms, areas between the function being drawn (i.e., the thick green curved line) and y = 0.1 should be shaded.

What it currently does is to shade areas between the function being drawn and y = 1.




________________________________
 From: OmPrakash Muppirala [via Apache Flex Users] <ml...@n4.nabble.com>
To: shaker <sh...@yahoo.com> 
Sent: Tuesday, July 15, 2014 1:58 PM
Subject: Re: Area Chart: How to Specify a "Base" for a Semilog Plot?
 


This is what I am seeing: http://i.imgur.com/xPTHgM7.png

If I understand you correct, this does look like what you want, right? 

Thanks, 
Om 


On Tue, Jul 1, 2014 at 7:44 AM, shaker <[hidden email]> wrote: 


> > The fills are done with respect to y = 1. Is there a way to get the fills 
> done with respect to y = 0.1? 
> 
> In case the above is not clear, if you copy the code and run, what I am 
> asking will be clear -- I want the areas above the y = 0.1 horizontal line 
> to be shaded. Currently, by default y = 1 is taken as the "base" and areas 
> above and below are filled. I want y = 0.1 to be the base. 
> 
> 
> 
> -- 
> View this message in context: 
> http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7113.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com. 
> 


________________________________
 
If you reply to this email, your message will be added to the discussion below:http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7279.html 
To unsubscribe from Area Chart:  How to Specify a "Base" for a Semilog Plot?, click here.
NAML



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7283.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Area Chart: How to Specify a "Base" for a Semilog Plot?

Posted by OmPrakash Muppirala <bi...@gmail.com>.
This is what I am seeing: http://i.imgur.com/xPTHgM7.png

If I understand you correct, this does look like what you want, right?

Thanks,
Om


On Tue, Jul 1, 2014 at 7:44 AM, shaker <sh...@yahoo.com> wrote:

> > The fills are done with respect to y = 1. Is there a way to get the fills
> done with respect to y = 0.1?
>
> In case the above is not clear, if you copy the code and run, what I am
> asking will be clear -- I want the areas above the y = 0.1 horizontal line
> to be shaded. Currently, by default y = 1 is taken as the "base" and areas
> above and below are filled. I want y = 0.1 to be the base.
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7113.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Area Chart: How to Specify a "Base" for a Semilog Plot?

Posted by shaker <sh...@yahoo.com>.
> The fills are done with respect to y = 1. Is there a way to get the fills
done with respect to y = 0.1? 

In case the above is not clear, if you copy the code and run, what I am
asking will be clear -- I want the areas above the y = 0.1 horizontal line
to be shaded. Currently, by default y = 1 is taken as the "base" and areas
above and below are filled. I want y = 0.1 to be the base.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Area-Chart-How-to-Specify-a-Base-for-a-Semilog-Plot-tp7112p7113.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.