D3 - get y domain from two different inputs
up vote
0
down vote
favorite
I have a stackblitz here - https://stackblitz.com/edit/ng-first-v-last-arrows-t1tt8e?embed=1&file=src/app/bar-chart.ts&hideNavigation=1
I have two separate bars that are created with different start and finish value.
Currently the y.domain is created with hard coded numbers
this.y.domain([93, 106])
The data looks like this.
{
phase: 'One',
start: 102,
finish: 100
},
{
phase: 'One',
start: 98,
finish: 101
}
I need the lowest value from the start values and the highest from the finish values.
How can I get these value in the y.domain array
d3.js
add a comment |
up vote
0
down vote
favorite
I have a stackblitz here - https://stackblitz.com/edit/ng-first-v-last-arrows-t1tt8e?embed=1&file=src/app/bar-chart.ts&hideNavigation=1
I have two separate bars that are created with different start and finish value.
Currently the y.domain is created with hard coded numbers
this.y.domain([93, 106])
The data looks like this.
{
phase: 'One',
start: 102,
finish: 100
},
{
phase: 'One',
start: 98,
finish: 101
}
I need the lowest value from the start values and the highest from the finish values.
How can I get these value in the y.domain array
d3.js
you need the highest and lowest value of the start and finish combined, put all of them in an array and calld3.extent
– rioV8
Nov 11 at 11:42
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a stackblitz here - https://stackblitz.com/edit/ng-first-v-last-arrows-t1tt8e?embed=1&file=src/app/bar-chart.ts&hideNavigation=1
I have two separate bars that are created with different start and finish value.
Currently the y.domain is created with hard coded numbers
this.y.domain([93, 106])
The data looks like this.
{
phase: 'One',
start: 102,
finish: 100
},
{
phase: 'One',
start: 98,
finish: 101
}
I need the lowest value from the start values and the highest from the finish values.
How can I get these value in the y.domain array
d3.js
I have a stackblitz here - https://stackblitz.com/edit/ng-first-v-last-arrows-t1tt8e?embed=1&file=src/app/bar-chart.ts&hideNavigation=1
I have two separate bars that are created with different start and finish value.
Currently the y.domain is created with hard coded numbers
this.y.domain([93, 106])
The data looks like this.
{
phase: 'One',
start: 102,
finish: 100
},
{
phase: 'One',
start: 98,
finish: 101
}
I need the lowest value from the start values and the highest from the finish values.
How can I get these value in the y.domain array
d3.js
d3.js
asked Nov 11 at 11:25
ttmt
1,985114997
1,985114997
you need the highest and lowest value of the start and finish combined, put all of them in an array and calld3.extent
– rioV8
Nov 11 at 11:42
add a comment |
you need the highest and lowest value of the start and finish combined, put all of them in an array and calld3.extent
– rioV8
Nov 11 at 11:42
you need the highest and lowest value of the start and finish combined, put all of them in an array and call
d3.extent
– rioV8
Nov 11 at 11:42
you need the highest and lowest value of the start and finish combined, put all of them in an array and call
d3.extent
– rioV8
Nov 11 at 11:42
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248238%2fd3-get-y-domain-from-two-different-inputs%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
you need the highest and lowest value of the start and finish combined, put all of them in an array and call
d3.extent
– rioV8
Nov 11 at 11:42