Created
November 22, 2017 22:25
-
-
Save bryantee/368340bae5b19a129e2e69a41bf2b534 to your computer and use it in GitHub Desktop.
determine spacing when you know width of items and total width of parent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const spaceBetweenDataPoints = (this.chartDimensions.width - data.length * DATA_POINT_SIZE) / (data.length + 1); | |
const leftMargin = spaceBetweenDataPoints * (index + 1) + (index > 0 ? (index) * DATA_POINT_SIZE : 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment