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

Function getInnerLabels

test/specs/core.scale.spec.js:904–926  ·  view source on GitHub ↗
(scaleOptions, data, labels)

Source from the content-addressed store, hash-verified

902 const linearData = [{x: 200, y: 12}, {x: 451, y: 14}, {x: 999, y: 14}];
903
904 function getInnerLabels(scaleOptions, data, labels) {
905 const chart = window.acquireChart({
906 type: 'line',
907 data: {
908 labels,
909 datasets: [{data}]
910 },
911 options: {
912 scales: {
913 x: Object.assign({
914 ticks: {
915 align: 'inner',
916 showLabelBackdrop: true,
917 backdropPadding: 0
918 }
919 }, scaleOptions)
920 }
921 }
922 });
923 return chart.scales.x.getLabelItems()
924 .slice()
925 .sort((a, b) => a.options.translation[0] - b.options.translation[0]);
926 }
927
928 function expectInnerAlignment(items) {
929 const first = items[0];

Callers 1

core.scale.spec.jsFile · 0.85

Calls 1

getLabelItemsMethod · 0.65

Tested by

no test coverage detected