diff --git a/src/charts/_bar.scss b/src/charts/_bar.scss index 1c13fea..a7db857 100644 --- a/src/charts/_bar.scss +++ b/src/charts/_bar.scss @@ -186,14 +186,16 @@ } @for $i from 1 through $max-items { &.show-#{$i}-y-axes { - tbody { - tr { + &:not(.labels-after) { + tbody tr { background-size: ( 100% / $i ) 100%; - background-image: linear-gradient( - 90deg, - var( --axis-color ) var( --axis-width ), - transparent var( --axis-width ) - ); + background-image: linear-gradient( -90deg, var( --axis-color ) var( --axis-width ), transparent var( --axis-width ) ); + } + } + &.labels-after { + tbody tr { + background-size: ( 100% / $i ) 100%; + background-image: linear-gradient( 90deg, var( --axis-color ) var( --axis-width ), transparent var( --axis-width ) ); } } } diff --git a/src/charts/_column.scss b/src/charts/_column.scss index c701f47..535affd 100644 --- a/src/charts/_column.scss +++ b/src/charts/_column.scss @@ -179,18 +179,19 @@ } } } - @for $i from 1 through 10 { + @for $i from 1 through $max-items { &.show-#{$i}-x-axes { - tbody { - background-size: 100% ( 100% / $i ); - background-image: linear-gradient( - var( --axis-color ) var( --axis-width ), - transparent var( --axis-width ) - ); - - // tr { - // border-block-start-color: transparent; - // } + &:not(.labels-before) { + tbody tr { + background-size: 100% ( 100% / $i ); + background-image: linear-gradient( var( --axis-color ) var( --axis-width ), transparent var( --axis-width ) ); + } + } + &.labels-before { + tbody tr { + background-size: 100% ( 100% / $i ); + background-image: linear-gradient( 0deg, var( --axis-color ) var( --axis-width ), transparent var( --axis-width ) ); + } } } } diff --git a/src/index.html b/src/index.html index 8f752a7..694593d 100644 --- a/src/index.html +++ b/src/index.html @@ -193,7 +193,7 @@

Bar Chart

Single dataset

- +
@@ -256,7 +256,7 @@

Single dataset

Multiple reverse

-
Months Compare
+
@@ -297,7 +297,7 @@

Multiple reverse

Multiple labels-after

-
Countries Compare
+
@@ -483,7 +483,7 @@

Column Chart

Single dataset

-
Countries Compare
+
@@ -546,7 +546,7 @@

Single dataset

Multiple reverse

-
Months Compare
+
@@ -587,7 +587,7 @@

Multiple reverse

Multiple labels-before

-
Countries Compare
+
Countries Compare