-
Notifications
You must be signed in to change notification settings - Fork 239
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
feat(bullet-chart): Add the bullet-chart component #1061
Conversation
tests/pages/bullet-charts.html
Outdated
<div class="bullet-chart-pf-title-spacer"></div> | ||
<div class="bullet-chart-pf-title-labels-container"> | ||
<div class="bullet-chart-pf-title"> | ||
Text Label</div> |
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.
Just a formatting thing, but the closing </div>
could be moved to the next line to be consistent with the .bullet-chart-pf-title/.bullet-chart-pf-details
block above. The above block and this one could also be changed so each <div>
, the text and the closing </div>
are on a single line to match the title/detail blocks below (or the title/detail blocks below could be expanded to 3 lines like this one and the block above)
I'm probably just out of the loop on this pattern, but why aren't the orange and red data lines included in the legend? |
I don't believe the thresholds are supposed to be represented in the legend. @serenamarie125 ? |
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.
@jeff-phillips-18 @michael-coker although the design documentation does show it in the legend by default, from a space perspective when utilizing a bullet chart, there won't be room for all of that in most situations. IMO, the default should just be to show the values & ranges in the legend. If people want to add the thresholds, they should be able to override.
@kybaker can you provide input on the legend spacing? I know there are conventions because we have legends in our charts, but can't seem to find any guidance on that |
@jeff-phillips-18 - I think everything about the design looks good, except the legend spacing (that @serenamarie125 mentioned.) Here are is the spacing that should be used:
|
Updated to comments above. @jennyhaines please take another look. |
@jeff-phillips-18 - this looks perfect to me! |
@michael-coker @matthewcarleton Can you take another look now that the visuals are correct? |
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.
LGTM!
@jeff-phillips-18 I'm assuming it's OK that the legend items wrap? And I see this...
But that item doesn't appear to overflow or show ellipses, it will just grow to match the content. |
Correct. We could add a max-width if we want to prevent it from getting too long. Thoughts? |
Checked with @serenamarie125 and @jennyhaines, will set a max-width of 150px. |
e13ff9c
to
52ca4f1
Compare
Updated, thanks! |
The horizontal What about making both the horizontal and vertical versions |
fd4beab
to
588922a
Compare
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.
LGTM @jeff-phillips-18
src/less/charts.less
Outdated
border-style: solid; | ||
border-width: 10px; | ||
height: 20px; | ||
margin-left: -10px; |
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.
I would use transform: translateX(-50%);
here just to avoid fixed units whenever possible. And change margin-left: 0;
on the vertical CSS below to transform: translateX(0);
src/less/charts.less
Outdated
} | ||
|
||
.bullet-chart-pf-value-dot { | ||
border-radius: 10px; |
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.
Use border-radius: 50%;
to avoid fixed units whenever possible.
src/less/charts.less
Outdated
.bullet-chart-pf-value-dot { | ||
border-radius: 10px; | ||
border-style: solid; | ||
border-width: 10px; |
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.
Is there a reason you're using border
properties instead of background-color
to define the dot color?
src/less/charts.less
Outdated
.bullet-chart-pf { | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; |
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 looks unnecessary, the element should grow to fill the available space by default.
src/less/charts.less
Outdated
height: 20px; | ||
margin: 20px 0; | ||
position: relative; | ||
width: 100%; |
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 looks unnecessary, the element should grow to fill the available space by default.
src/less/charts.less
Outdated
.bullet-chart-pf-legend { | ||
margin-top: 7px; | ||
text-align: center; | ||
width: 100%; |
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 (and width: initial;
on the vertical version below) look unnecessary.
src/less/charts.less
Outdated
padding-right: 0; | ||
text-align: center; | ||
} | ||
} |
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.
To center this text relative to the chart (and not the axis below itchange this .bullet-chart-pf-title-labels-container
block to this. Basically just create 25px
of space at the bottom of the container to match the height of the axis row.
.bullet-chart-pf-title-labels-container {
margin: 0 10px 25px 0;
text-align: right;
.bullet-chart-pf-vertical & {
text-align: center;
margin: 10px 0;
}
}
tests/pages/bullet-charts.html
Outdated
<div class="bullet-chart-pf-details">Measure Details</div> | ||
</div> | ||
<!-- add this div to vertically center the titles --> | ||
<div class="bullet-chart-pf-axis"></div> |
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.
You can remove this if you apply the CSS changes previously mentioned
tests/pages/bullet-charts.html
Outdated
<div class="bullet-chart-pf-details">Measure Details</div> | ||
</div> | ||
<!-- add this div to vertically center the titles --> | ||
<div class="bullet-chart-pf-axis"></div> |
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.
you can also remove this
Updated. Thanks for the simplifications @michael-coker ! |
c652a23
to
049e2d6
Compare
Adds the html/css implementation of http://www.patternfly.org/pattern-library/data-visualization/bullet-chart/#design
73be693
e0998e5
to
73be693
Compare
Adds the html/css implementation of
http://www.patternfly.org/pattern-library/data-visualization/bullet-chart/#design
Please not this was implemented to include patternfly/patternfly-design#662
Link to rawgit and/or image
https://rawgit.com/jeff-phillips-18/patternfly/bullet-chart-dist/dist/tests/bullet-charts.html
PR checklist (if relevant)