_c3.scss 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. /* ------------------------------------------------------------------------------
  2. *
  3. * # C3 charts
  4. *
  5. * Styles for C3.js visualization library
  6. *
  7. * ---------------------------------------------------------------------------- */
  8. // Check if component is enabled
  9. @if $enable-c3 {
  10. // Base
  11. .c3 {
  12. // Use smaller text
  13. svg {
  14. font-size: $font-size-sm;
  15. }
  16. // Paths and lines defaults
  17. path,
  18. line {
  19. fill: none;
  20. stroke: $gray-600;
  21. }
  22. path.domain {
  23. shape-rendering: crispEdges;
  24. }
  25. // Disable text selection
  26. text {
  27. user-select: none;
  28. }
  29. }
  30. //
  31. // Components
  32. //
  33. // Default shape rendering style
  34. .c3-legend-item-tile,
  35. .c3-xgrid-focus,
  36. .c3-ygrid,
  37. .c3-event-rect,
  38. .c3-bars path {
  39. shape-rendering: crispEdges;
  40. }
  41. // Arcs
  42. .c3-chart-arc {
  43. path {
  44. stroke: $white;
  45. }
  46. text {
  47. fill: $white;
  48. font-size: $font-size-base;
  49. }
  50. }
  51. // Grid
  52. .c3-grid {
  53. line {
  54. stroke: $gray-500;
  55. }
  56. text {
  57. fill: $gray-500;
  58. }
  59. }
  60. .c3-xgrid,
  61. .c3-ygrid {
  62. stroke-dasharray: 3 3;
  63. }
  64. // Text on chart
  65. .c3-text {
  66. font-weight: $font-weight-semibold;
  67. &.c3-empty {
  68. fill: $gray-700;
  69. font-size: 2em;
  70. }
  71. }
  72. // Line
  73. .c3-line {
  74. stroke-width: 2px;
  75. }
  76. // Area
  77. .c3-area {
  78. stroke-width: 0;
  79. opacity: 0.4;
  80. }
  81. // Point
  82. .c3-circle._expanded_ {
  83. stroke-width: 1.5px;
  84. stroke: $white;
  85. }
  86. .c3-selected-circle {
  87. fill: $white;
  88. stroke-width: 2px;
  89. }
  90. // Bar
  91. .c3-bar {
  92. stroke-width: 0;
  93. &._expanded_ {
  94. fill-opacity: 0.75;
  95. }
  96. }
  97. // Arc
  98. .c3-chart-arcs-title {
  99. font-size: $h6-font-size;
  100. }
  101. .c3-chart-arcs {
  102. .c3-chart-arcs-background {
  103. fill: $gray-300;
  104. stroke: none;
  105. }
  106. .c3-chart-arcs-gauge-unit {
  107. fill: $body-color;
  108. font-size: $h6-font-size;
  109. }
  110. .c3-chart-arcs-gauge-max,
  111. .c3-chart-arcs-gauge-min {
  112. fill: $gray-200;
  113. }
  114. }
  115. .c3-chart-arc .c3-gauge-value {
  116. fill: $body-color;
  117. font-size: $h1-font-size;
  118. }
  119. // Focus
  120. .c3-target {
  121. &.c3-focused {
  122. opacity: 1;
  123. path.c3-line,
  124. path.c3-step {
  125. stroke-width: 2px;
  126. }
  127. }
  128. &.c3-defocused {
  129. opacity: 0.3 !important;
  130. }
  131. }
  132. // Region
  133. .c3-region {
  134. fill: $color-slate-600;
  135. fill-opacity: .1;
  136. }
  137. // Brush
  138. .c3-brush .extent {
  139. fill-opacity: .1;
  140. }
  141. // Legend
  142. .c3-legend-item {
  143. font-size: $font-size-sm;
  144. }
  145. .c3-legend-background {
  146. fill: $white;
  147. stroke: lightgray;
  148. stroke-width: 1;
  149. opacity: 0.75;
  150. }
  151. // Tooltip
  152. .c3-tooltip {
  153. border-collapse: collapse;
  154. border-spacing: 0;
  155. background-color: $white;
  156. empty-cells: show;
  157. opacity: 0.95;
  158. th {
  159. background-color: $gray-900;
  160. padding: $table-cell-padding-xs;
  161. text-align: center;
  162. color: $white;
  163. border: $table-border-width solid $gray-900;
  164. font-weight: $font-weight-semibold;
  165. }
  166. td {
  167. padding: $table-cell-padding-xs;
  168. background-color: $white;
  169. border: $table-border-width solid $border-color;
  170. > span {
  171. display: inline-block;
  172. margin-right: map-get($spacers, 2);
  173. @include size($badge-mark-size);
  174. }
  175. &.value {
  176. text-align: right;
  177. }
  178. }
  179. }
  180. }