MCPcopy
hub / github.com/chartjs/Chart.js / createScale

Function createScale

test/specs/scale.time.tests.js:5–25  ·  view source on GitHub ↗
(data, options, dimensions)

Source from the content-addressed store, hash-verified

3 describe('auto', jasmine.fixture.specs('scale.time'));
4
5 function createScale(data, options, dimensions) {
6 var width = (dimensions && dimensions.width) || 400;
7 var height = (dimensions && dimensions.height) || 50;
8
9 options = options || {};
10 options.type = 'time';
11 options.id = 'xScale0';
12
13 var chart = window.acquireChart({
14 type: 'line',
15 data: data,
16 options: {
17 scales: {
18 x: options
19 }
20 }
21 }, {canvas: {width: width, height: height}});
22
23
24 return chart.scales.x;
25 }
26
27 function getLabels(scale) {
28 return scale.ticks.map(t => t.label);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected