Issue 29 in elycharts: axis.min does affect line graphs of positive numbers

49 views
Skip to first unread message

elyc...@googlecode.com

unread,
Aug 23, 2013, 5:58:43 AM8/23/13
to elyc...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 29 by b.engelb...@gmail.com: axis.min does affect line graphs of
positive numbers
http://code.google.com/p/elycharts/issues/detail?id=29

What steps will reproduce the problem?
1. Configure axis.l.min as 300
2. Plot a line graph of these values (all > 300):
[410, 406, 482, 613, 337, 530, 483, 518, 469, 393, 463, 570, 323]

What is the expected output?
Vertical axis starts at 300
What do you see instead?
Vertical axis starts at 0

What version of the product are you using? v2.1.4-SNAPSHOT
On what operating system? Windows 7, Google Chrome


Please provide any additional information below.
There are two coding issues that together cause this:
1: lines 3137 - 3138:
for (i = 0; i < showValues.length; i++)
plot.from.push(0);
This causes minimum value > 0 to be ignored.
To fix, second line could be replaced by:
plot.from.push(plot.to[i]);

2. Lines 3219 - 3220:
if (axis[lidx].min)
axis[lidx].min = Math.floor(axis[lidx].min / v) * v;
At this point, v is always > axis[lidx].min, thus Math.floor(axis[lidx].min
/ v) is always equal to 0. It appears that it was intended to round to a
multiple of basev (10 in the example), i.e., the second line could be fixed
as:
axis[lidx].min = Math.floor(axis[lidx].min / basev) * basev;


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

elyc...@googlecode.com

unread,
Aug 28, 2013, 10:44:15 AM8/28/13
to elyc...@googlegroups.com

Comment #1 on issue 29 by b.engelb...@gmail.com: axis.min does affect line
I found that my modification at lines 3137 - 3138 did not work for graph
types other than "line". To fix that, second line should be:
plot.from.push((props.type == 'line') ? plot.to[i] : 0);

elyc...@googlecode.com

unread,
Feb 5, 2014, 2:53:01 AM2/5/14
to elyc...@googlegroups.com
Updates:
Status: Invalid
Owner: stefano....@gmail.com

Comment #2 on issue 29 by stefano....@gmail.com: axis.min does affect line
"axis.l.min" is not intended to define the "START" of the axis.
It is instead intended to define a minimum value for the "END" of the axis.

So if your values are all lower than 300 and your chart is "automatically"
labeled with a maximum value of, lets say, 100, using axis.l.min you can
tell elycharts to still use 300 for the end value of the l axis.

This is useful when you have multiple charts and you want them to be on the
same "l" scale.

What you are asking is instead to have the chart starting from a value
different than "0" and this is not supported by elychart.

If you need this feature it should be opened as a feature and a patch
should include a new parameter, not a change on the "min" property that is
already serving a different goal.
Reply all
Reply to author
Forward
0 new messages