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

Function makeView

test/specs/plugin.tooltip.tests.js:1380–1461  ·  view source on GitHub ↗
(title, body, footer)

Source from the content-addressed store, hash-verified

1378 describe('text align', function() {
1379 var defaults = Chart.defaults;
1380 var makeView = function(title, body, footer) {
1381 const model = {
1382 // Positioning
1383 x: 100,
1384 y: 100,
1385 width: 100,
1386 height: 100,
1387 xAlign: 'left',
1388 yAlign: 'top',
1389
1390 options: {
1391 setContext: () => model.options,
1392 enabled: true,
1393
1394 padding: 5,
1395
1396 // Body
1397 bodyFont: {
1398 family: defaults.font.family,
1399 style: defaults.font.style,
1400 size: defaults.font.size,
1401 },
1402 bodyColor: '#fff',
1403 bodyAlign: body,
1404 bodySpacing: 2,
1405
1406 // Title
1407 titleFont: {
1408 family: defaults.font.family,
1409 weight: 'bold',
1410 size: defaults.font.size,
1411 },
1412 titleColor: '#fff',
1413 titleAlign: title,
1414 titleSpacing: 2,
1415 titleMarginBottom: 6,
1416
1417 // Footer
1418 footerFont: {
1419 family: defaults.font.family,
1420 weight: 'bold',
1421 size: defaults.font.size,
1422 },
1423 footerColor: '#fff',
1424 footerAlign: footer,
1425 footerSpacing: 2,
1426 footerMarginTop: 6,
1427
1428 // Appearance
1429 caretSize: 5,
1430 cornerRadius: 6,
1431 caretPadding: 2,
1432 borderColor: '#aaa',
1433 borderWidth: 1,
1434 backgroundColor: 'rgba(0,0,0,0.8)',
1435 multiKeyBackground: '#fff',
1436 displayColors: false
1437

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected