Sign in to follow this  
saptarshi

Force yAxisMinValue?

Recommended Posts

The yAxisMinValue behavior seems broken to me.  When I specify a yAxisMinValue for a chart, it seems like the actual minimum value for the axis is the minimum of ( yAxisMinValue , [smallest y-coordinate provided in my chart] ).  Has anyone found a workaround for this problem?  The current behavior is very frustrating.

Share this post


Link to post
Share on other sites

Adding, the proposed workaround of setting values less than the yminvalue to be equal to yminvalue is not acceptable, because it alters the slope of the line segment that crosses the line x=yminvalue. So for example if I'm plotting the points [1,-1], [2,1], [3, 3] with yminvalue=0, I would expect to see a straight line segment clipped by the edge of the chart at x=1.5, but with the proposed solution, I see a line that "bends" at [2,1] to produce a line segment that terminates at x=1 instead. I hope that I haven't confused my explanation too badly :)

Share this post


Link to post
Share on other sites

Thanks very much! Here is a sample dataset I'm trying to plot. Using the evaluation version of Fusion Charts 3, the y-axis extends to -3 instead of stopping at 0 as specified in the chart attribute.

 

 

 


<chart alternateVGridColor="CCCCCC" showBorder="0" alternateHGridColor="CCCCCC" yAxisMinValue="0" divLineColor="888888" baseFontColor="666666" alternateVGridAlpha="20" defaultAnimation="0" alternateHGridAlpha="20" bgColor="FFFFFF" xAxisMaxValue="10" divLineAlpha="50" canvasBorderThickness="1">



<dataset anchorAlpha="0" showValues="0" drawLine="1" color="#eec446">

<set x="0.5" y="-0.6931471805599453"/>

<set x="1" y="0"/>

<set x="1.5" y="0.4054651081081644"/>

<set x="2" y="0.6931471805599453"/>

<set x="2.5" y="0.9162907318741551"/>

<set x="3" y="1.0986122886681097"/>

<set x="3.5" y="1.252762968495368"/>

<set x="4" y="1.3862943611198905"/>

<set x="4.5" y="1.5040773967762741"/>

<set x="5" y="1.6094379124341002"/>

<set x="5.5" y="1.7047480922384252"/>

<set x="6" y="1.791759469228055"/>

<set x="6.5" y="1.8718021769015913"/>

<set x="7" y="1.9459101490553132"/>

<set x="7.5" y="2.0149030205422646"/>

<set x="8" y="2.0794415416798357"/>

<set x="8.5" y="2.1400661634962707"/>

<set x="9" y="2.1972245773362195"/>

<set x="9.5" y="2.2512917986064953"/>

<set x="10" y="2.302585092994046"/>

</dataset>



<dataset anchorAlpha="0" showValues="0" drawLine="1" color="#afd8f8">

<set x="2.5" y="-0.3862943611198906"/>

<set x="3" y="1"/>

<set x="3.5" y="1.8109302162163287"/>

<set x="4" y="2.386294361119891"/>

<set x="4.5" y="2.83258146374831"/>

<set x="5" y="3.1972245773362195"/>

<set x="5.5" y="3.505525936990736"/>

<set x="6" y="3.772588722239781"/>

<set x="6.5" y="4.008154793552548"/>

<set x="7" y="4.218875824868201"/>

<set x="7.5" y="4.4094961844768505"/>

<set x="8" y="4.58351893845611"/>

<set x="8.5" y="4.743604353803183"/>

<set x="9" y="4.891820298110627"/>

<set x="9.5" y="5.029806041084529"/>

<set x="10" y="5.1588830833596715"/>

</dataset>



<dataset anchorAlpha="0" showValues="0" drawLine="1" color="#cb4b4b">

<set x="1.5" y="-1.70816136715364"/>

<set x="2" y="-0.09953876174499299"/>

<set x="2.5" y="0.7377352846277348"/>

<set x="3" y="1.2821434828500972"/>

<set x="3.5" y="1.6760544604778846"/>

<set x="4" y="1.9799027799348427"/>

<set x="4.5" y="2.224539054478355"/>

<set x="5" y="2.4276549859813316"/>

<set x="5.5" y="2.600252059996497"/>

<set x="6" y="2.749594242347978"/>

<set x="6.5" y="2.8807050932181295"/>

<set x="7" y="2.9971894317348293"/>

<set x="7.5" y="3.1017131964318283"/>

<set x="8" y="3.196298104259336"/>

<set x="8.5" y="3.2825102382323354"/>

<set x="9" y="3.3615850245299334"/>

<set x="9.5" y="3.434512552537589"/>

<set x="10" y="3.502097335743868"/>

</dataset>



<dataset anchorAlpha="0" showValues="0" drawLine="1" color="#4da74d">

<set x="0" y="1"/>

<set x="0.5" y="1.05"/>

<set x="1" y="1.1"/>

<set x="1.5" y="1.15"/>

<set x="2" y="1.2"/>

<set x="2.5" y="1.25"/>

<set x="3" y="1.3"/>

<set x="3.5" y="1.35"/>

<set x="4" y="1.4"/>

<set x="4.5" y="1.45"/>

<set x="5" y="1.5"/>

<set x="5.5" y="1.55"/>

<set x="6" y="1.6"/>

<set x="6.5" y="1.65"/>

<set x="7" y="1.7000000000000001"/>

<set x="7.5" y="1.75"/>

<set x="8" y="1.8"/>

<set x="8.5" y="1.85"/>

<set x="9" y="1.9"/>

<set x="9.5" y="1.9500000000000001"/>

<set x="10" y="2"/>

</dataset>



<dataset anchorAlpha="0" showValues="0" drawLine="1" color="#9440ed">

<set x="0" y="3"/>

<set x="0.5" y="2.75"/>

<set x="1" y="2.5"/>

<set x="1.5" y="2.25"/>

<set x="2" y="2"/>

<set x="2.5" y="1.75"/>

<set x="3" y="1.5"/>

<set x="3.5" y="1.25"/>

<set x="4" y="1"/>

<set x="4.5" y="0.75"/>

<set x="5" y="0.5"/>

<set x="5.5" y="0.25"/>

<set x="6" y="0"/>

<set x="6.5" y="-0.25"/>

<set x="7" y="-0.5"/>

<set x="7.5" y="-0.75"/>

<set x="8" y="-1"/>

<set x="8.5" y="-1.25"/>

<set x="9" y="-1.5"/>

<set x="9.5" y="-1.75"/>

<set x="10" y="-2"/>

</dataset>



<styles>

<definition>

<style alpha="30" name="MyShadow" type="Shadow"/>

</definition>

<application>

<apply styles="MyShadow" toObject="DATAPLOT"/>

<apply styles="MyShadow" toObject="CANVAS"/>

</application>

</styles>

</chart>

Share this post


Link to post
Share on other sites

Hello,

 

 

 

The solution is to not keep data points that you will not show in the chart.

 

 

 

Since you do not wish to show data points that are below the X-axis (y=0), don't put any point which has a Y-coordinate less than zero. This will ensure that the gradient of the line will be intact/unaffected for the rest of the chart.

 

 

 

I am attaching the Before-After screenshots and the edited XML as attachments.

 

 

 

Hope this helps. :)

post-5234-128441573377_thumb.jpg

post-5234-128441573395_thumb.jpg

Data.xml

Share this post


Link to post
Share on other sites

Thank you for the reply! I understand the proposed solution, but as shown in your screenshot, that has the unfortunate side effect of making some of the arcs appear to "hang in the air" because the first segment, which would cross the axis, is not drawn, since one of its endpoints is now null.

 

 

 

I believe that I could use linear interpolation to introduce extra points in my dataset precisely at y=0 to complete the arcs, but as this is a rather cumbersome solution, I was hoping that there was another approach.

Share this post


Link to post
Share on other sites

Hello,

 

 

 

Yes. The chart will not be able to extrapolate points on its own.

 

 

 

I suggest you use some discrete data extrapolation formula used in Numerical Analysis (possibly non-linear considering the nature of the curve) to calculate the point of crossing the x-axis.

 

 

 

While this may be somewhat cumbersome on your part, looks like this is the only work around. :)

 

 

 

Hope this helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this