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

Add way to get positioning of BarNodes from BarChartNode #37

Closed
jessegreenberg opened this issue May 22, 2019 · 5 comments
Closed

Add way to get positioning of BarNodes from BarChartNode #37

jessegreenberg opened this issue May 22, 2019 · 5 comments
Assignees

Comments

@jessegreenberg
Copy link
Contributor

In Energy Skate Park, we need to position a button under underneath one of a BarNode label like https://user-images.githubusercontent.com/8419308/47312442-98af5300-d5f9-11e8-8c1b-dc79fa96c786.png

It would be helpful to be able to get the positions of bars and labels.

@jessegreenberg
Copy link
Contributor Author

I added getBarLabelLocation to BarChartNode for this. @Denz1994 would you mind reviewing this?

jessegreenberg added a commit that referenced this issue May 22, 2019
@jessegreenberg jessegreenberg removed their assignment May 22, 2019
@Denz1994
Copy link
Contributor

Just out of curiosity, why wouldn't specifying the labelNode not work in this case?

this.barChart =new BarChartNode( [ {
        entries: [ barEntry ],
        labelString: barLabelString,
        labelNode: TrashCanButtonNode // or TrashCanButtonVBox for added VStrut padding
      }, rangeProperty, options);

I'm looking at BarChartNode.js:

   if ( bar.labelNode ) {
        barLabelVBox.addChild( bar.labelNode );
      }

Or do we need more flexibility in where the node is placed?

@jessegreenberg
Copy link
Contributor Author

Oh my gosh I totally missed this, sorry! Ill give that a try instead.

@jessegreenberg
Copy link
Contributor Author

That works beautifully, thanks @Denz1994. I am just going to remove my changes for this issue.

@jessegreenberg
Copy link
Contributor Author

Removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants