Skip to content
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 Visual Builder wrong color rules on multiple metric #31455

Merged
merged 1 commit into from
Feb 21, 2019

Conversation

sulemanof
Copy link
Contributor

Fix #16431 .
The same problem has been already fixed for gauge tab in PR: #27810 - find out the full description of a problem there.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@flash1293 flash1293 self-requested a review February 19, 2019 14:57
Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Tested and works

@timroes timroes added Feature:TSVB TSVB (Time Series Visual Builder) v7.0.0 Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 v7.2.0 labels Feb 20, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

Copy link
Contributor

@alexwizp alexwizp left a comment

Choose a reason for hiding this comment

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

Code LGTM.

@@ -34,7 +34,8 @@ function getColors(props) {
if (model.background_color_rules) {
model.background_color_rules.forEach((rule) => {
if (rule.operator && rule.value != null) {
const value = series[0] && getLastValue(series[0].data) || 0;
const value = (series[0] && getLastValue(series[0].data)) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

What about to simplify it
const value = getLastValue((series[0] || series[1] || {}).data || 0);

But it's optional

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:TSVB TSVB (Time Series Visual Builder) release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.0.0 v7.2.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Color rules not working on visual builder when splitting via terms agg
5 participants