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

Function retrieveAxisFromDatasets

src/core/core.config.js:61–69  ·  view source on GitHub ↗
(id, config)

Source from the content-addressed store, hash-verified

59}
60
61function retrieveAxisFromDatasets(id, config) {
62 if (config.data && config.data.datasets) {
63 const boundDs = config.data.datasets.filter((d) => d.xAxisID === id || d.yAxisID === id);
64 if (boundDs.length) {
65 return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);
66 }
67 }
68 return {};
69}
70
71function mergeScaleConfig(config, options) {
72 const chartDefaults = overrides[config.type] || {scales: {}};

Callers 1

mergeScaleConfigFunction · 0.85

Calls 1

getAxisFromDatasetFunction · 0.85

Tested by

no test coverage detected