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

Threshold line on bar/line/area charts #42632

Merged
merged 16 commits into from
Aug 22, 2019
Merged

Conversation

FilipRy
Copy link
Contributor

@FilipRy FilipRy commented Aug 5, 2019

Summary

Closes #5037.

User can define a threshold which is visualized as a line on the chart. The width and style [full line, dashed line, dash-dotted line] of the line can be set by the user as well.

Screenshot from 2019-08-05 21-33-02

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@elasticmachine
Copy link
Contributor

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@FilipRy
Copy link
Contributor Author

FilipRy commented Aug 8, 2019

@markov00 @timroes can you please review this ?

@timroes timroes requested review from markov00 and timroes August 8, 2019 15:26
@timroes timroes added Feature:XYAxis XY-Axis charts (bar, area, line) release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Aug 8, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@timroes timroes requested a review from nickofthyme August 8, 2019 15:28
@timroes
Copy link
Contributor

timroes commented Aug 8, 2019

Jenkins, test this

@timroes
Copy link
Contributor

timroes commented Aug 8, 2019

Hi Filip,

thanks a lot for your contribution. We'll try to review and test this as soon as possible to get it merged as quickly as possible. Could you please make sure this is up to date with master again (you can simply run node scripts/update_prs 42632 from the Kibana repository).

@markov00 do we already have a threshold line feature in Elastic Charts? If not I think we should open an issue for that, so we can move that feature over with us :-)

Cheers,
Tim

@timroes
Copy link
Contributor

timroes commented Aug 8, 2019

Also some heads up, we currently have another PR open that converts the options panel for point series charts to React (#42828). If that progresses faster than this PR, we would need to ask you to rewrite the editor part in React, but can't right now tell you which one will be faster, sorry.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@timroes
Copy link
Contributor

timroes commented Aug 8, 2019

Those test failures seem related to this PR.

@FilipRy
Copy link
Contributor Author

FilipRy commented Aug 8, 2019

Those test failures seem related to this PR.

@timroes I believe I fixed the bug causing those tests to fail. You can kick off the build again.

@timroes
Copy link
Contributor

timroes commented Aug 9, 2019

Jenkins, test this

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@markov00
Copy link
Member

markov00 commented Aug 9, 2019

@timroes

@markov00 do we already have a threshold line feature in Elastic Charts? If not I think we should open an issue for that, so we can move that feature over with us :-)

Yes we already have that in Elastic-Charts

@markov00
Copy link
Member

markov00 commented Aug 9, 2019

We can also color bars above a specific threshold if you want :)

@timroes
Copy link
Contributor

timroes commented Aug 14, 2019

Testing this PR. It seems that we currently show the line on the very top or bottom of the chart if the value the line should be is outside the chart:

screenshot-20190814-114018

This is in my opinion a bit confusing, since this could lead the user to thinking the line would (in that example) sit at 16 (or just above the actual value series) while it actually is at 100. Having negative threshold lines might look even more confusing since it would just sit at 0 in this chart. I am wondering if we should hide the line altogether in case it's outside the chart? @markov00 @monfera any opinions?

Also I would let the user give the line a specific color. Currently we just get one of the series colors, but that's kind of very random. So if you have a split series with 5 different lines it'll just get the color of one of the lines, even though there is no connection between the threshold line and that specific series. I think that would be better if the user just decides on the color manually. Since (as mentioned above) we'll very shortly merge the PR that converts that editor to React, I fear you'll need to rewrite that editor in React, and thus I would not implement the color picker before we have merged the other PR, so you're not unnecessary doing some color picker stuff now in Angular, while you anyway need to rewrite it then in React (where we can actually just use the EUI color picker).

@timroes timroes self-assigned this Aug 14, 2019
@timroes
Copy link
Contributor

timroes commented Aug 14, 2019

@FilipRy We now merged the PR with React refactoring and this PR would need to be needed to brought up in sync with master.

@timroes timroes added the v8.0.0 label Aug 22, 2019
@timroes
Copy link
Contributor

timroes commented Aug 22, 2019

Jenkins, test this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@timroes
Copy link
Contributor

timroes commented Aug 22, 2019

Jenkins, test this - git failure in CI

@elasticmachine
Copy link
Contributor

💔 Build Failed

@timroes
Copy link
Contributor

timroes commented Aug 22, 2019

Jenkins, test this - another try

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@timroes timroes left a comment

Choose a reason for hiding this comment

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

Tested on Chrome Linux. Works as I would expect it to work in a wide range of tested scenarios. Multiple y-axis will cause multiple threshold lines, one for each y-axis, which is what I would assume to happen (even though in that case not that useful, but that's up to the user to decide). Checked the code, and code LGTM. Waiting for CI to work for getting this green.

@timroes
Copy link
Contributor

timroes commented Aug 22, 2019

Jenkins, test this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@timroes
Copy link
Contributor

timroes commented Aug 22, 2019

Jenkins, test this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@Crazybus
Copy link

jenkins test this please

@Crazybus
Copy link

Jenkins, test this

1 similar comment
@Crazybus
Copy link

Jenkins, test this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@Crazybus
Copy link

Jenkins, test this

@timroes timroes changed the title Visualization - Threshold line on time series charts Threshold line on bar/line/area charts Aug 22, 2019
@elasticmachine
Copy link
Contributor

💔 Build Failed

@timroes
Copy link
Contributor

timroes commented Aug 22, 2019

Jenkins, test this - I fixed a couple of remaining TS issues

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@timroes timroes merged commit 3da522d into elastic:master Aug 22, 2019
timroes pushed a commit to timroes/kibana that referenced this pull request Aug 22, 2019
* first steps towards threshold line (histogram)

* threshold line added for all point_series charts

* added settings for threshold line

* last fixes

* fixed typo

* default values for thresholdLineOptions

* resolving conflicts

* threshold line not displayed when out of the canvas

* linting

* added color picker for threshold line

* fixed assigning of a static color and i18 select options

* changing default color and lintings

* Fix remaining TS issues
timroes pushed a commit that referenced this pull request Aug 22, 2019
* first steps towards threshold line (histogram)

* threshold line added for all point_series charts

* added settings for threshold line

* last fixes

* fixed typo

* default values for thresholdLineOptions

* resolving conflicts

* threshold line not displayed when out of the canvas

* linting

* added color picker for threshold line

* fixed assigning of a static color and i18 select options

* changing default color and lintings

* Fix remaining TS issues
@timroes
Copy link
Contributor

timroes commented Aug 22, 2019

Filip, thanks you a lot for providing this change. I merged and backported it now, so it'll be released in Kibana in 7.4. Thanks for your effort and I hope we see further contributions from you to Kibana 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:XYAxis XY-Axis charts (bar, area, line) release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.4.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Threshold Lines in Charts
7 participants