8000 Implement bar labels (issue 34) by n-riesco · Pull Request #1159 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Implement bar labels (issue 34) #1159

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

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: bar texts
* bar_test.js: Test `textposition`.

* bar_test.js: Test that `textposition` can also be restyled.

* bar_test.js: Test whether outside bars are correctly identified when
  `barnorm: 'fraction'`.

* bar_attrs_relative: Updated to test the bar text functionality.

* bar_attrs_group_norm: Updated to test the bar text functionality.

* bar_attrs_relative: Reduced font size of text "Three" to ensure the
  baseline image also fits the text inside the bar.

* bar_attrs_group_norm: Exercise functionality to rotate bar texts.

* bar_attrs_group_norm: Use "50%" as bar texts to ensure the bounding
  box width is larger than its height (unfortunately, this wasn't case
  when the baseline images were generated using "0.5", because the
  height of the bounding box includes some white space).
  • Loading branch information
n-riesco committed Nov 17, 2016
commit b7bfc97f777904f32ae985b65d176c23e09411aa
Binary file modified test/image/baselines/bar_attrs_group_norm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/bar_attrs_relative.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions test/image/mocks/bar_attrs_group_norm.json
10899
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"data":[
{
"text":"50%",
"textposition":"inside",
"outsidetextfont": {"size":32},
"base":[100,40,25,10],
"x":[-50,10,25,40],
"type":"bar"
}, {
"text":"50%",
"textposition":"outside",
"base":[0,60,75,90],
"x":[50,-10,-25,-40],
"type":"bar"
Expand Down
12 changes: 11 additions & 1 deletion test/image/mocks/bar_attrs_relative.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,37 @@
"data":[
{
"width":[1,0.8,0.6,0.4],
"text":[1,2,3333333333,4],
"textposition":"outside",
"y":[1,2,3,4],
"x":[1,2,3,4],
"type":"bar"
}, {
"width":[0.4,0.6,0.8,1],
"text":["Three",2,"inside text",0],
"textposition":"auto",
"textfont":{"size":[10]},
"y":[3,2,1,0],
"x":[1,2,3,4],
"type":"bar"
}, {
"width":1,
"text":[-1,-3,-2,-4],
"textposition":"inside",
"y":[-1,-3,-2,-4],
"x":[1,2,3,4],
"type":"bar"
}, {
"y":[0,-1,-3,-2],
"text":[0,"outside text",-3,-2],
"textposition":"auto",
"y":[0,-0.25,-3,-2],
"x":[1,2,3,4],
"type":"bar"
}
],
"layout":{
"xaxis": {"showgrid":true},
"yaxis": {"range":[-6,6]},
"height":400,
"width":400,
"barmode":"relative",
Expand Down
Loading
0