MCPcopy Create free account
hub / github.com/chartjs/Chart.js / createScale

Function createScale

test/specs/scale.time.spec.js:3–23  ·  view source on GitHub ↗
(data, options, dimensions)

Source from the content-addressed store, hash-verified

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

Callers 1

scale.time.spec.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected