-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix repeating values on Y-axis of C&U charts #40
Conversation
66ac68f
to
e74bdb3
Compare
@miq-bot remove_label wip |
there are some style issues (codeclimate) and why don't you place the code to |
6a0f5a0
to
2a07611
Compare
var format = data.axis.y.tick.format; | ||
max = _.max(getChartColumnDataValues(data.data.columns)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have a var
too. (CC may warn about it, but ignore that, double var is way less bad then forgetting about it and having an accidental global)
var min_showed = getChartFormatedValue(format, min); | ||
var change_format = true; | ||
// if there are no valid values or there is only single values big enough, then not change formating function | ||
// TODO MOVE IT TO FUNCTION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like a TODO :)
var format = ManageIQ.charts.chartData.candu[this.config.bindto.split('_').pop()].xml.miq.format; | ||
var minMax = getMinMaxFromChart(this); | ||
// if there are no valid values or there is only single values big enough, then return | ||
if (!minMax || minMax[0] === minMax[1]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
identical code introduced in miq_application.js
114a6fb
to
dfb7669
Compare
dfb7669
to
d53153f
Compare
LGTM now, except this could really use a before & after screenshot, and one more thing... The changeFormat bit looks rather close to the recalculatePrecision bit, so maybe these could be a shared function.. |
https://bugzilla.redhat.com/show_bug.cgi?id=1383821 (cherry picked from commit 8c1585103969cd55270d6b98889a1d49b54f9760)
(cherry picked from commit 5bc7efab2573a508c58f7e32ee5275a5caf646e1)
d53153f
to
8e83bc1
Compare
@himdel Code moved to function, added screenshots :) |
Checked commits PanSpagetka/manageiq-ui-classic@510075f~...c63af43 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
Tested in the UI, it wooorks! :) |
@PanSpagetka @himdel I assume this should be |
Euwe backport (to manageiq repo) details:
|
@simaishi yes, thanks for adding it! :) |
Fix repeating values on Y-axis of C&U charts. This is caused by not having labels with appropriate precision.
This issue has two parts. First when chart is loaded, should adjust precision to values. Most of the times it already is done by ruby, but not always. Second, adjust precision when you click on legend, hide/show series of data, change dynamically labels precision according to shown data.
Links [Optional]
https://bugzilla.redhat.com/show_bug.cgi?id=1383821
Screenshots
Before:
After:
Steps for Testing/QA
(converted from ManageIQ/manageiq#13289)