| Page 1 of 1 | [ 5 posts ] |
|
Hello,
there seems to be a problem with the column chart if some series has negative values then the base line is moved to negative values. I would expect that if there is one series with negative values then this column has to go down from the zero line and the other columns start from zero line and go up. Currently the behavior is that the "zero" line is moved to the biggest negative value and all columns start from this level: For example I have used the code from the examples page: (function() { YUI().use('charts', function (Y) { var myDataValues = [ {category:"5/1/2010", values:2000, expenses:3700, revenue:2200}, {category:"5/2/2010", values:50, expenses:9100, revenue:-100}, {category:"5/3/2010", values:400, expenses:1100, revenue:-500}, {category:"5/4/2010", values:200, expenses:1900, revenue:-1500}, {category:"5/5/2010", values:5000, expenses:5000, revenue:2650} ]; var mychart = new Y.Chart({dataProvider:myDataValues, render:"#mychart", type:"column"}); }); })(); then all columns render from -1500. Is this expected behavior or a bug |
Alberto SantiniYUI Contributor
|
Hello Tobias.
Maybe it is related with the following ticket: http://yuilibrary.com/projects/yui3/ticket/2531700 Regards, IceBox |
|
I have opened a ticket here and will get a fix in for the next pr release.
http://yuilibrary.com/projects/yui3/ticket/2532327 Below is patch (minimally tested) that you can use until the next pr. chartsbug2532327Patch.jsClick here to see the revision history on this Gist.Just embed this code before your charts instantiation. Post back if you run into any issues with the patch. Thanks, Tripp |
|
Thank you very much for your quick reply and the bugfix. The code seems to work.
While testing there appeared two minor issues. When having a chart with positive and negative values there is noch "axes line" Zero line displayed and only the Columns go up and down from this point. My workaround for this was to enable the horizontal gridlines. This way there were several horizontal lines displayed. But in some cases there wasn't any of the gridlines at the zero level there the key showAlwaysZero has to be set to true Code: horizontalGridlines: { styles: { line: { color: "#dad8c9" } } }, axes:{ yAxis: { alwaysShowZero: true } } Perhaps it might be useful to draw a zero line in this cases or set those ticks at the yAxis by Default. |
|
Currently, there is no notion of a "zero gridline". Feel free to file a ticket. In the interim, you can access the chart's graphic reference and explicitly draw a line. Below is a link to a gist that draws a line at 85%. You should be able to adjust the algorithm to draw a line on the zero value.
https://gist.github.com/2003595 Please post back if you have any issues, I'll be happy to help sort it with you. Thanks, Tripp |
| Page 1 of 1 | [ 5 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group