chartist 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -47,6 +47,8 @@ That's why we started Chartist and our goal is to solve all of the above issues.
47
47
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
48
48
  <a href="#whats-new-in-v1">What's new in v1?</a>
49
49
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
50
+ <a href="#examples">Examples</a>
51
+ <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
50
52
  <a href="#contribution">Contribution</a>
51
53
  <hr />
52
54
 
@@ -158,6 +160,57 @@ import type {
158
160
 
159
161
  </details>
160
162
 
163
+ ## Examples
164
+
165
+ <details>
166
+ <summary>Bar Chart</summary>
167
+
168
+ - [Bi-polar bar chart](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/bar/bi-polar-interpolated)
169
+ - [Distributed series](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/bar/distributed-series)
170
+ - [Extreme responsive configuration](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/bar/extreme-responsive)
171
+ - [Horizontal bar chart](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/bar/horizontal)
172
+ - [Label placement](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/bar/label-position)
173
+ - [Multi-line labels](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/bar/multiline)
174
+ - [Overlapping bars on mobile](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/bar/overlapping-bars)
175
+ - [Stacked bar chart](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/bar/stacked)
176
+ - [Add peak circles using the draw events](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/bar/with-circle-modify-drawing)
177
+
178
+ </details>
179
+
180
+ <details>
181
+ <summary>Line Chart</summary>
182
+
183
+ - [Line chart with area](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/area)
184
+ - [Auto scale axis](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/axis-auto)
185
+ - [Fixed and auto scale axis](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/axis-fixed-and-auto)
186
+ - [Bi-polar Line chart with area only](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/bipolar-area)
187
+ - [Filled holes in data](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/data-fill-holes)
188
+ - [Holes in data](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/data-holes)
189
+ - [Using events to replace graphics](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/modify-drawing)
190
+ - [Only whole numbers](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/only-integer)
191
+ - [SVG Path animation](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/path-animation)
192
+ - [Line scatter diagram with responsive settings](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/scatter-random)
193
+ - [Series Overrides](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/series-override)
194
+ - [Simple line chart](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/simple)
195
+ - [Simple responsive options](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/simple-responsive)
196
+ - [Line Interpolation / Smoothing](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/simple-smoothing)
197
+ - [Simple SMIL Animations](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/simple-svg-animation)
198
+ - [Advanced SMIL Animations](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/svg-animation)
199
+ - [Timeseries](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/line/timeseries)
200
+
201
+ </details>
202
+
203
+ <details>
204
+ <summary>Pie Chart</summary>
205
+
206
+ - [Pie chart with custom labels](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/pie/custom-labels)
207
+ - [Animating a Donut with Svg.animate](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/pie/donut-animation)
208
+ - [Donut chart](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/pie/donut-chart)
209
+ - [Simple pie chart](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/pie/simple)
210
+ - [Gauge chart](http://codesandbox.io/s/github/chartist-js/chartist/main/sandboxes/pie/simple-gauge)
211
+
212
+ </details>
213
+
161
214
  ## Plugins
162
215
 
163
216
  Coming soon.
@@ -1 +1 @@
1
- {"version":3,"file":"Axis.d.ts","sourceRoot":"","sources":["../../src/axes/Axis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,SAAS,EACT,mBAAmB,EACnB,8BAA8B,EAC9B,gBAAgB,EACjB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;CAiBZ,CAAC;AAEX,oBAAY,UAAU,GAAG,OAAO,SAAS,CAAC,CAAC,CAAC;AAC5C,oBAAY,UAAU,GAAG,OAAO,SAAS,CAAC,CAAC,CAAC;AAC5C,oBAAY,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAEhD,8BAAsB,IAAI;aAYN,KAAK,EAAE,SAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK;IAbxB,SAAgB,YAAY,EAAE,SAAS,CAAC;IACxC,SAAgB,KAAK,EACjB;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,GACD,SAAS,CAAC;IACd,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAGlB,K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EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EAAE;IAQjC,QAAQ,CAAC,YAAY,CACnB,KAAK,EAAE,8BAA8B,GAAG,KAAK,EAC7C,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,gBAAgB,GACxB,MAAM;IAET,mBAAmB,CACjB,SAAS,EAAE,GAAG,EACd,UAAU,EAAE,GAAG,EACf,YAAY,EAAE,mBAAmB,EACjC,YAAY,EAAE,YAAY;CAyG7B"}
package/dist/index.cjs CHANGED
@@ -2300,7 +2300,7 @@ class Axis {
2300
2300
  // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to
2301
2301
  // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will
2302
2302
  // still be visible inside of the chart padding.
2303
- labelLength = Math.max(this.axisLength - projectedValue, 30);
2303
+ labelLength = Math.max(this.axisLength - projectedValue, this.axisLength / this.ticks.length);
2304
2304
  }
2305
2305
  // Skip grid lines and labels where interpolated label values are falsey (except for 0)
2306
2306
  if (labelValue !== "" && isFalseyButZero(labelValue)) {