Skip to content

Conversation

wkerl
Copy link
Contributor

@wkerl wkerl commented Dec 28, 2015

I've just started learning python a few weeks ago and this is my first public commit.
For an an analysis I needed a fixed range of [0,1] - percentage data. So I've added the option to set min and/or max values for the y-axis.

I will very gladly change something to improve my contribution. For example I saw that you require tests. But I don't know how and where to add them.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why or if we use both parameters? maybe and will be more appropriate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It adds the possibility to set either min or max. So you can set y_axis_scale_min =-1 but leave it 'open' towards the maximum by just not specifying it.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so if y_axis_scale_min is -1 and chart.y_axis_scale_max is empty, the next line will produce:

chart.forceY([-1,]);

Are you sure forceY method will be happy with [-1,] (that's the same in JS as [-1]) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@areski I did not find any documentation on the forcceY method and experimented a bit with it and worked for me all the time. Also [,1] works flawless in case only the max value is defined.
I could add an if statement in the case that only min is defined, but for the max case the first parameter needs to stay undefined anyway.
It seems more consistent to me to leave it undefined in both cases.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems good enough, thanks for testing!

@areski
Copy link
Owner

areski commented Dec 29, 2015

Nice job for a first commit :) I just made a tiny comment

areski added a commit that referenced this pull request Jan 4, 2016
possibility to adjust the y-axis range
@areski areski merged commit 5604f2e into areski:develop Jan 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants