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

Function getInnerLabels

test/specs/core.scale.tests.js:823–845  ·  view source on GitHub ↗
(scaleOptions, data, labels)

Source from the content-addressed store, hash-verified

821 const linearData = [{x: 200, y: 12}, {x: 451, y: 14}, {x: 999, y: 14}];
822
823 function getInnerLabels(scaleOptions, data, labels) {
824 const chart = window.acquireChart({
825 type: 'line',
826 data: {
827 labels,
828 datasets: [{data}]
829 },
830 options: {
831 scales: {
832 x: Object.assign({
833 ticks: {
834 align: 'inner',
835 showLabelBackdrop: true,
836 backdropPadding: 0
837 }
838 }, scaleOptions)
839 }
840 }
841 });
842 return chart.scales.x.getLabelItems()
843 .slice()
844 .sort((a, b) => a.options.translation[0] - b.options.translation[0]);
845 }
846
847 function expectInnerAlignment(items) {
848 const first = items[0];

Callers 1

Calls 1

getLabelItemsMethod · 0.65

Tested by

no test coverage detected