Jump to content
JChartFX Community
  • 0
Sign in to follow this  
timopu

Problems setting Min/Max for Y Axis

Question

timopu    0

Hello again,

I'm encountering a strange issue with setMin/setMax when using this data:

[{"myinfomonitor_ts":"2016-10-17T06:03:09.770Z","FI_max":0,"shift_sum":511,"engine_number_count":539},{"myinfomonitor_ts":"2016-10-24T06:03:09.770Z","FI_max":0,"shift_sum":339,"engine_number_count":534},{"myinfomonitor_ts":"2016-10-31T07:03:09.770Z","FI_max":0,"shift_sum":307,"engine_number_count":487},{"myinfomonitor_ts":"2016-11-07T07:03:09.770Z","FI_max":0,"shift_sum":418,"engine_number_count":445},{"myinfomonitor_ts":"2016-11-14T07:03:09.770Z","FI_max":0,"shift_sum":427,"engine_number_count":445},{"myinfomonitor_ts":"2016-11-21T07:03:09.770Z","FI_max":0,"shift_sum":371,"engine_number_count":387},{"myinfomonitor_ts":"2016-11-28T07:03:09.770Z","FI_max":0,"shift_sum":565,"engine_number_count":486},{"myinfomonitor_ts":"2016-12-05T07:03:09.770Z","FI_max":0,"shift_sum":620,"engine_number_count":698},{"myinfomonitor_ts":"2016-12-12T07:03:09.770Z","FI_max":0,"shift_sum":485,"engine_number_count":485},{"myinfomonitor_ts":"2016-12-19T07:03:09.770Z","FI_max":0,"shift_sum":155,"engine_number_count":213},{"myinfomonitor_ts":"2016-12-26T07:03:09.770Z","FI_max":0,"shift_sum":0,"engine_number_count":0},{"myinfomonitor_ts":"2017-01-02T07:03:09.770Z","FI_max":0,"shift_sum":0,"engine_number_count":0},{"myinfomonitor_ts":"2017-01-09T07:03:09.770Z","FI_max":0,"shift_sum":0,"engine_number_count":0},{"myinfomonitor_ts":"2017-01-16T07:03:09.770Z","FI_max":0,"shift_sum":0,"engine_number_count":0},{"myinfomonitor_ts":"2017-01-23T07:03:09.770Z","FI_max":0,"shift_sum":0,"engine_number_count":0},{"myinfomonitor_ts":"2017-01-30T07:03:09.770Z","FI_max":0,"shift_sum":0,"engine_number_count":0},{"myinfomonitor_ts":"2017-02-06T07:03:09.770Z","FI_max":0,"shift_sum":0,"engine_number_count":0},{"myinfomonitor_ts":"2017-02-13T07:03:09.770Z","FI_max":0,"shift_sum":0,"engine_number_count":0}]


1) When the min is set to -800 and max to 800, there is an additional -1000 line drawn on the chart ( pic1.png )
pic1.png

2) When min is set to 0 and max to 800, Y axis line is not drawn at all.
pic2.png

3) When min is set to 400 and max to 800, The chart gets inverted and stepping goes crazy.
pic3.png

Seems that this might not be related to the dataset I'm using, because the same effect is seen with other data sets. 

How could I solve this?

br,
Timo

 

 

pic1.png

Edited by timopu
unintentional crap in post.

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
JuanC    3

I was unable to duplicate the issues you describe (and are visible in the screenshots).

Can you please provide the code you use to customize the chart?

Regards,

JuanC

Share this post


Link to post
Share on other sites
  • 0
timopu    0

Hello JuanC,

I did some further digging into this and found out that this is a classic Javascript type conversion bug - the code received the value for axes from a form field and the variable got passed to JChartFX as a string instead of being a Number. After I added explicit conversion to Number, the min/max values started to behave as expected.

br,
Timo

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  

×