Chart.defaults.font.family = 'Whyte'; document.addEventListener('DOMContentLoaded', function () { const canvases = document.getElementsByClassName('canvas-1'); for (let i = 0; i < canvases.length; i++) { const ctx = canvases[i].getContext('2d'); new Chart(ctx, { type: 'bar', data: { labels: ['3%', '3.33%', '3.67%', '4%', '4.33%', '4.67%', '5%'], datasets: [ { label: 'TRI', data: [11.999, 11.199, 10.512, 10.094, 9.265, 8.499, 7.952], backgroundColor: '#fdac02', borderColor: '#000000', borderWidth: 1, }, ], }, options: { responsive: true, maintainAspectRatio: false, plugins: { title: { display: true, text: "TRI en fonction du taux d'intérêt du crédit", color: '#333333', font: { size: 16, }, padding: { bottom: 20, }, }, legend: { display: false, }, tooltip: { callbacks: { label: function (context) { let label = context.dataset.label || ''; if (label) { label += ': '; } if (context.parsed.y !== null) { label += context.parsed.y + '%'; } return label; }, }, }, }, scales: { x: { ticks: { color: '#333333', autoSkip: true, }, }, y: { ticks: { color: '#333333', callback: function (value, index, values) { return value + '%'; }, }, }, }, }, }); } }); document.addEventListener('DOMContentLoaded', function () { const tau = [0.03, 0.033333, 0.0366667, 0.04, 0.04333, 0.046667, 0.05]; const capitalConstitue = [197021, 176282, 161103, 147629, 136141, 124101, 115874]; const capitalInvesti = [176474, 157997, 141823, 129874, 120441, 109194, 101904]; const formatCurrency = (value) => new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR', minimumFractionDigits: 0, maximumFractionDigits: 0, }).format(value); const canvases = document.getElementsByClassName('canvas-2'); for (let i = 0; i < canvases.length; i++) { const ctx = canvases[i].getContext('2d'); new Chart(ctx, { type: 'line', data: { labels: tau.map((value) => `${(value * 100).toFixed(1)}%`), datasets: [ { label: 'Capital constitué', data: capitalConstitue, backgroundColor: '#fdac02', borderColor: '#000000', borderWidth: 1, }, { label: 'Capital investi', data: capitalInvesti, backgroundColor: '#007bff', borderColor: '#007bff', borderWidth: 1, }, ], }, options: { responsive: true, maintainAspectRatio: false, plugins: { title: { display: true, text: "Capital en fonction du taux d'intérêt", color: '#333333', font: { size: 16, }, padding: { bottom: 20, }, }, legend: { display: true, }, tooltip: { callbacks: { label: function (context) { const value = context.parsed.y; return formatCurrency(value); }, }, }, }, scales: { x: { title: { display: false, }, ticks: { color: '#333333', }, }, y: { title: { display: false, }, ticks: { color: '#333333', callback: function (value) { return formatCurrency(value); }, }, }, }, }, }); } }); document.addEventListener('DOMContentLoaded', function () { const canvases = document.getElementsByClassName('canvas-3'); const data = [ { date: '31-07-2023', reinvested: 0, nonReinvested: 0, }, { date: '31-08-2023', reinvested: 200, nonReinvested: 200, }, { date: '30-09-2023', reinvested: 400, nonReinvested: 400, }, { date: '31-10-2023', reinvested: 600, nonReinvested: 600, }, { date: '30-11-2023', reinvested: 800.668246301273, nonReinvested: 800.668261513115, }, { date: '31-12-2023', reinvested: 1002.00473556229, nonReinvested: 1002.00478453934, }, { date: '31-01-2024', reinvested: 1204.00946947899, nonReinvested: 1204.00956907869, }, { date: '29-02-2024', reinvested: 1406.68468753276, nonReinvested: 1406.68484791873, }, { date: '31-03-2024', reinvested: 1610.03263427889, nonReinvested: 1610.03285382956, }, { date: '30-04-2024', reinvested: 1814.05555941346, nonReinvested: 1814.05581959013, }, { date: '31-05-2024', reinvested: 2018.75572529823, nonReinvested: 2018.7559854749, }, { date: '30-06-2024', reinvested: 2224.13540702372, nonReinvested: 2224.13559928041, }, { date: '31-07-2024', reinvested: 2443.796374509, nonReinvested: 2443.64841887506, }, { date: '31-08-2024', reinvested: 2650.54612325503, nonReinvested: 2650.40421154479, }, { date: '30-09-2024', reinvested: 2857.97917674154, nonReinvested: 2857.83784577518, }, { date: '31-10-2024', reinvested: 3066.1721893666, nonReinvested: 3066.03143390908, }, { date: '30-11-2024', reinvested: 3275.05624563519, nonReinvested: 3274.91602160517, }, { date: '31-12-2024', reinvested: 3484.63367831854, nonReinvested: 3484.49390300461, }, { date: '31-01-2025', reinvested: 3694.90707141051, nonReinvested: 3694.76761809691, }, { date: '28-02-2025', reinvested: 3905.87878407317, nonReinvested: 3905.73947661187, }, { date: '31-03-2025', reinvested: 4117.55118878018, nonReinvested: 4117.41179614931, }, { date: '30-04-2025', reinvested: 4329.92667219238, nonReinvested: 4329.78690302884, }, { date: '31-05-2025', reinvested: 4543.00763444011, nonReinvested: 4542.86713154875, }, { date: '30-06-2025', reinvested: 4756.7964891993, nonReinvested: 4756.65482404082, }, { date: '31-07-2025', reinvested: 5000.42771533084, nonReinvested: 4999.40711329073, }, { date: '31-08-2025', reinvested: 5215.65871242369, nonReinvested: 5214.66913250204, }, { date: '30-09-2025', reinvested: 5431.58749698591, nonReinvested: 5430.59817229259, }, { date: '31-10-2025', reinvested: 5648.38645777314, nonReinvested: 5647.39700264833, }, { date: '30-11-2025', reinvested: 5865.90540193019, nonReinvested: 5864.9153494479, }, { date: '31-12-2025', reinvested: 6084.14680516833, nonReinvested: 6083.1556039468, }, { date: '31-01-2026', reinvested: 6303.11366760869, nonReinvested: 6302.12067611049, }, { date: '28-02-2026', reinvested: 6522.80849304318, nonReinvested: 6521.81297392337, }, { date: '31-03-2026', reinvested: 6743.23379938153, nonReinvested: 6742.23491380701, }, { date: '30-04-2026', reinvested: 6964.3921204246, nonReinvested: 6963.38892238424, }, { date: '31-05-2026', reinvested: 7186.28600422225, nonReinvested: 7185.27743483045, }, { date: '30-06-2026', reinvested: 7408.91801313552, nonReinvested: 7407.90289493163, }, { date: '31-07-2026', reinvested: 7677.73588188896, nonReinvested: 7674.46768565797, }, { date: '31-08-2026', reinvested: 7901.89515803896, nonReinvested: 7898.70497574579, }, { date: '30-09-2026', reinvested: 8126.75543737404, nonReinvested: 8123.56387245136, }, { date: '31-10-2026', reinvested: 8352.60207346568, nonReinvested: 8349.4080334709, }, { date: '30-11-2026', reinvested: 8579.19942995034, nonReinvested: 8576.00170793691, }, { date: '31-12-2026', reinvested: 8806.55013544583, nonReinvested: 8803.34739089193, }, { date: '31-01-2027', reinvested: 9034.65763030121, nonReinvested: 9031.44838310656, }, { date: '28-02-2027', reinvested: 9263.52457274843, nonReinvested: 9260.30719752408, }, { date: '31-03-2027', reinvested: 9493.1536358776, nonReinvested: 9489.92635613219, }, { date: '30-04-2027', reinvested: 9723.54751035494, nonReinvested: 9720.30839268907, }, { date: '31-05-2027', reinvested: 9954.70890180572, nonReinvested: 9951.45585011862, }, { date: '30-06-2027', reinvested: 10186.640530861, nonReinvested: 10183.3712805711, }, { date: '31-07-2027', reinvested: 10481.9243891059, nonReinvested: 10474.3455520624, }, { date: '31-08-2027', reinvested: 10715.4840665153, nonReinvested: 10708.0562008144, }, { date: '30-09-2027', reinvested: 10949.7345217794, nonReinvested: 10942.3022207171, }, { date: '31-10-2027', reinvested: 11185.0938072286, nonReinvested: 11177.6549133243, }, { date: '30-11-2027', reinvested: 11421.2364573223, nonReinvested: 11413.7886758439, }, { date: '31-12-2027', reinvested: 11658.1652636448, nonReinvested: 11650.7061142128, }, { date: '31-01-2028', reinvested: 11895.8841317239, nonReinvested: 11888.410942035, }, { date: '29-02-2028', reinvested: 12134.3958841096, nonReinvested: 12126.9057843544, }, { date: '31-03-2028', reinvested: 12373.7033588696, nonReinvested: 12366.1932759061, }, { date: '30-04-2028', reinvested: 12613.809413302, nonReinvested: 12606.2760648555, }, { date: '31-05-2028', reinvested: 12854.7169202908, nonReinvested: 12847.1568091852, }, { date: '30-06-2028', reinvested: 13096.428768336, nonReinvested: 13088.8381767586, }, { date: '31-07-2028', reinvested: 13419.5243338833, nonReinvested: 13404.8441285714, }, { date: '31-08-2028', reinvested: 13662.9831061262, nonReinvested: 13648.557015076, }, { date: '30-09-2028', reinvested: 13907.1066443293, nonReinvested: 13892.6714802182, }, { date: '31-10-2028', reinvested: 14152.4681334871, nonReinvested: 14138.0202752088, }, { date: '30-11-2028', reinvested: 14398.6476611056, nonReinvested: 14384.1833401119, }, { date: '31-12-2028', reinvested: 14645.6481918401, nonReinvested: 14631.1633993652, }, { date: '31-01-2029', reinvested: 14893.4741221901, nonReinvested: 14878.9646027374, }, { date: '28-02-2029', reinvested: 15142.1284489119, nonReinvested: 15127.5896950093, }, { date: '31-03-2029', reinvested: 15391.614184843, nonReinvested: 15377.0414313394, }, { date: '30-04-2029', reinvested: 15641.9343636617, nonReinvested: 15627.3225820678, }, { date: '31-05-2029', reinvested: 15893.0920351612, nonReinvested: 15878.435928042, }, { date: '30-06-2029', reinvested: 16145.090265262, nonReinvested: 16130.3842606815, }, { date: '31-07-2029', reinvested: 16497.4131799592, nonReinvested: 16472.0706281794, }, { date: '31-08-2029', reinvested: 16751.2979026595, nonReinvested: 16726.347476073, }, { date: '30-09-2029', reinvested: 17005.8029869951, nonReinvested: 16980.8370805685, }, { date: '31-10-2029', reinvested: 17261.6821652039, nonReinvested: 17236.6952522565, }, { date: '30-11-2029', reinvested: 17518.4162151013, nonReinvested: 17493.4026262186, }, { date: '31-12-2029', reinvested: 17776.0082844594, nonReinvested: 17750.9620535343, }, { date: '31-01-2030', reinvested: 18034.4632873271, nonReinvested: 18009.378144849, }, { date: '28-02-2030', reinvested: 18293.7844044622, nonReinvested: 18268.6537728439, }, { date: '31-03-2030', reinvested: 18553.9748331549, nonReinvested: 18528.7918213017, }, { date: '30-04-2030', reinvested: 18815.0377930928, nonReinvested: 18789.7951910325, }, { date: '31-05-2030', reinvested: 19076.9765204951, nonReinvested: 19051.6667940801, }, { date: '30-06-2030', reinvested: 19339.7942681082, nonReinvested: 19314.4095537875, }, { date: '31-07-2030', reinvested: 19722.8338496665, nonReinvested: 19682.4529993564, }, { date: '31-08-2030', reinvested: 19987.7012284561, nonReinvested: 19947.8905640149, }, { date: '30-09-2030', reinvested: 20253.1232846654, nonReinvested: 20213.2887656672, }, { date: '31-10-2030', reinvested: 20520.0629961071, nonReinvested: 20480.1967018439, }, { date: '30-11-2030', reinvested: 20787.8967096055, nonReinvested: 20747.9905988854, }, { date: '31-12-2030', reinvested: 21056.627765915, nonReinvested: 21016.6734432234, }, { date: '31-01-2031', reinvested: 21326.2616239231, nonReinvested: 21286.2503325565, }, { date: '28-02-2031', reinvested: 21596.80165797, nonReinvested: 21556.7242761895, }, { date: '31-03-2031', reinvested: 21868.251259255, nonReinvested: 21828.0982952885, }, { date: '30-04-2031', reinvested: 22140.6138428672, nonReinvested: 22100.3754299881, }, { date: '31-05-2031', reinvested: 22413.8928407206, nonReinvested: 22373.558732417, }, { date: '30-06-2031', reinvested: 22688.0917015331, nonReinvested: 22647.6512667646, }, { date: '31-07-2031', reinvested: 23103.4149043932, nonReinvested: 23042.7578500833, }, { date: '31-08-2031', reinvested: 23379.8532848542, nonReinvested: 23319.9902459065, }, { date: '30-09-2031', reinvested: 23656.7561880355, nonReinvested: 23596.858737562, }, { date: '31-10-2031', reinvested: 23935.3281451922, nonReinvested: 23875.3854302521, }, { date: '30-11-2031', reinvested: 24214.8356779009, nonReinvested: 24154.8367678337, }, { date: '31-12-2031', reinvested: 24495.2823294389, nonReinvested: 24435.215881408, }, { date: '31-01-2032', reinvested: 24776.6741314445, nonReinvested: 24716.5283834544, }, { date: '29-02-2032', reinvested: 25059.01466107, nonReinvested: 24998.7774292196, }, { date: '31-03-2032', reinvested: 25342.3075125172, nonReinvested: 25281.9661866053, }, { date: '30-04-2032', reinvested: 25626.5563052995, nonReinvested: 25566.0978445177, }, { date: '31-05-2032', reinvested: 25911.764675916, nonReinvested: 25851.1756046494, }, { date: '30-06-2032', reinvested: 26197.9362778169, nonReinvested: 26137.2026815454, }, { date: '31-07-2032', reinvested: 26647.1918749943, nonReinvested: 26560.1094135512, }, { date: '31-08-2032', reinvested: 26935.8231399383, nonReinvested: 26849.8105879646, }, { date: '30-09-2032', reinvested: 27224.8007864525, nonReinvested: 27138.7408532757, }, { date: '31-10-2032', reinvested: 27515.6071658808, nonReinvested: 27429.4854750258, }, { date: '30-11-2032', reinvested: 27807.3932921057, nonReinvested: 27721.1954559936, }, { date: '31-12-2032', reinvested: 28100.1629199802, nonReinvested: 28013.8740819127, }, { date: '31-01-2033', reinvested: 28393.9226823234, nonReinvested: 28307.5275094142, }, { date: '28-02-2033', reinvested: 28688.6763678194, nonReinvested: 28602.1590496377, }, { date: '31-03-2033', reinvested: 28984.4277822498, nonReinvested: 28897.7720271997, }, { date: '30-04-2033', reinvested: 29281.1807580568, nonReinvested: 29194.3697898534, }, { date: '31-05-2033', reinvested: 29578.9391446926, nonReinvested: 29491.9556989585, }, { date: '30-06-2033', reinvested: 29877.7068085723, nonReinvested: 29790.5331295453, }, { date: '31-07-2033', reinvested: 30362.6298070892, nonReinvested: 30242.0096149924, }, { date: '31-08-2033', reinvested: 30664.1113866555, nonReinvested: 30544.8959757053, }, { date: '30-09-2033', reinvested: 30965.7893560265, nonReinvested: 30846.510934236, }, { date: '31-10-2033', reinvested: 31269.4644853944, nonReinvested: 31150.1045049374, }, { date: '30-11-2033', reinvested: 31574.1662941933, nonReinvested: 31454.7062903378, }, { date: '31-12-2033', reinvested: 31879.8987572277, nonReinvested: 31760.3197414526, }, { date: '31-01-2034', reinvested: 32186.669137321, nonReinvested: 32066.9515901768, }, { date: '28-02-2034', reinvested: 32494.4814427228, nonReinvested: 32374.6053141627, }, { date: '31-03-2034', reinvested: 32803.3396986831, nonReinvested: 32683.2844053871, }, { date: '30-04-2034', reinvested: 33113.2479583931, nonReinvested: 32992.9923811895, }, { date: '31-05-2034', reinvested: 33424.2102919412, nonReinvested: 33303.7327733589, }, { date: '30-06-2034', reinvested: 33736.2307862592, nonReinvested: 33615.5091281957, }, { date: '31-07-2034', reinvested: 34258.647089465, nonReinvested: 34096.3593019805, }, { date: '31-08-2034', reinvested: 34573.6740896268, nonReinvested: 34413.1925038815, }, { date: '30-09-2034', reinvested: 34888.7114015988, nonReinvested: 34728.1482507653, }, { date: '31-10-2034', reinvested: 35205.9235431999, nonReinvested: 35045.2554002875, }, { date: '30-11-2034', reinvested: 35524.2122312942, nonReinvested: 35363.4158783491, }, { date: '31-12-2034', reinvested: 35843.5816681258, nonReinvested: 35682.633312626, }, { date: '31-01-2035', reinvested: 36164.0397755959, nonReinvested: 36002.9150432313, }, { date: '28-02-2035', reinvested: 36485.5907886678, nonReinvested: 36324.2647256605, }, { date: '31-03-2035', reinvested: 36808.2389590695, nonReinvested: 36646.6860305994, }, { date: '30-04-2035', reinvested: 37131.9885676925, nonReinvested: 36970.1826564152, }, { date: '31-05-2035', reinvested: 37456.8439120845, nonReinvested: 37294.7583167843, }, { date: '30-06-2035', reinvested: 37782.8093063941, nonReinvested: 37620.4167407517, }, { date: '31-07-2035', reinvested: 38344.6406372086, nonReinvested: 38131.4807034618, }, { date: '31-08-2035', reinvested: 38673.9480923644, nonReinvested: 38463.0706012977, }, { date: '30-09-2035', reinvested: 39003.0390645486, nonReinvested: 38792.0582469395, }, { date: '31-10-2035', reinvested: 39334.4923007768, nonReinvested: 39123.379079142, }, { date: '30-11-2035', reinvested: 39667.0750678049, nonReinvested: 39455.8007360119, }, { date: '31-12-2035', reinvested: 40000.7918016778, nonReinvested: 39789.3270340379, }, { date: '31-01-2036', reinvested: 40335.6511125346, nonReinvested: 40123.9659564563, }, { date: '29-02-2036', reinvested: 40671.6574680956, nonReinvested: 40459.7213486869, }, { date: '31-03-2036', reinvested: 41008.8153524861, nonReinvested: 40796.5970722169, }, { date: '30-04-2036', reinvested: 41347.1292801787, nonReinvested: 41134.597018623, }, { date: '31-05-2036', reinvested: 41686.6037819504, nonReinvested: 41473.7250956612, }, { date: '30-06-2036', reinvested: 42027.2434048317, nonReinvested: 41813.9852273218, }, { date: '31-07-2036', reinvested: 42630.5125047131, nonReinvested: 42356.1411857654, }, { date: '31-08-2036', reinvested: 42974.8777600973, nonReinvested: 42703.3489584274, }, { date: '30-09-2036', reinvested: 43318.7539719237, nonReinvested: 43047.0965740396, }, { date: '31-10-2036', reinvested: 43665.1901984782, nonReinvested: 43393.3686380284, }, { date: '30-11-2036', reinvested: 44012.8122503541, nonReinvested: 43740.7915361523, }, { date: '31-12-2036', reinvested: 44361.6248023666, nonReinvested: 44089.3692866851, }, { date: '31-01-2037', reinvested: 44711.6371819547, nonReinvested: 44439.1105529543, }, { date: '28-02-2037', reinvested: 45062.8540942919, nonReinvested: 44790.0193831791, }, { date: '31-03-2037', reinvested: 45415.2802604987, nonReinvested: 45142.0998425255, }, { date: '30-04-2037', reinvested: 45768.9204332207, nonReinvested: 45495.3560287426, }, { date: '31-05-2037', reinvested: 46123.7793809735, nonReinvested: 45849.7920566298, }, { date: '30-06-2037', reinvested: 46479.8618881021, nonReinvested: 46205.4120580874, }, { date: '31-07-2037', reinvested: 47126.6980073385, nonReinvested: 46779.5783768697, }, { date: '31-08-2037', reinvested: 47486.9432370214, nonReinvested: 47143.3198286915, }, { date: '30-09-2037', reinvested: 47846.375606005, nonReinvested: 47502.5945037633, }, { date: '31-10-2037', reinvested: 48208.5766388866, nonReinvested: 47864.5948785731, }, { date: '30-11-2037', reinvested: 48572.0233053205, nonReinvested: 48227.7987489225, }, { date: '31-12-2037', reinvested: 48936.7205221757, nonReinvested: 48592.2103487104, }, { date: '31-01-2038', reinvested: 49302.6783629509, nonReinvested: 48957.8390605063, }, { date: '28-02-2038', reinvested: 49669.9017733564, nonReinvested: 49324.6891490412, }, { date: '31-03-2038', reinvested: 50038.3957145345, nonReinvested: 49692.7648968648, }, { date: '30-04-2038', reinvested: 50408.1651803705, nonReinvested: 50062.0706216836, }, { date: '31-05-2038', reinvested: 50779.2151801433, nonReinvested: 50432.6106591157, }, { date: '30-06-2038', reinvested: 51151.5507385055, nonReinvested: 50804.3893627387, }, { date: '31-07-2038', reinvested: 51844.1954342682, nonReinvested: 51411.5267332737, }, { date: '31-08-2038', reinvested: 52221.1903005191, nonReinvested: 51792.7757772289, }, { date: '30-09-2038', reinvested: 52596.9912771527, nonReinvested: 52168.385795349, }, { date: '31-10-2038', reinvested: 52975.7810798192, nonReinvested: 52546.9332945573, }, { date: '30-11-2038', reinvested: 53355.8800523591, nonReinvested: 52926.739749234, }, { date: '31-12-2038', reinvested: 53737.2933549714, nonReinvested: 53307.809623662, }, { date: '31-01-2039', reinvested: 54120.0318354438, nonReinvested: 53690.1530611092, }, { date: '28-02-2039', reinvested: 54504.1006812092, nonReinvested: 54073.7745574148, }, { date: '31-03-2039', reinvested: 54889.5050946173, nonReinvested: 54458.6786270885, }, { date: '30-04-2039', reinvested: 55276.2503120815, nonReinvested: 54844.8698224423, }, { date: '31-05-2039', reinvested: 55664.3415849498, nonReinvested: 55232.3527145422, }, { date: '30-06-2039', reinvested: 56053.7841795124, nonReinvested: 55621.1318932505, }, { date: '31-07-2039', reinvested: 56794.5974389861, nonReinvested: 56262.2456269332, }, { date: '31-08-2039', reinvested: 57189.2618987403, nonReinvested: 56662.0379539869, }, { date: '30-09-2039', reinvested: 57582.287786644, nonReinvested: 57054.835093774, }, { date: '31-10-2039', reinvested: 57978.5348240079, nonReinvested: 57450.7925968907, }, { date: '30-11-2039', reinvested: 58376.1585212761, nonReinvested: 57848.0674689798, }, { date: '31-12-2039', reinvested: 58775.1642808949, nonReinvested: 58246.6644204351, }, { date: '31-01-2040', reinvested: 59175.563752394, nonReinvested: 58646.5943991175, }, { date: '29-02-2040', reinvested: 59577.3623639078, nonReinvested: 59047.8621475008, }, { date: '31-03-2040', reinvested: 59980.5655580505, nonReinvested: 59450.472427546, }, { date: '30-04-2040', reinvested: 60385.1788130064, nonReinvested: 59854.4300417274, }, { date: '31-05-2040', reinvested: 60791.2076215301, nonReinvested: 60259.739812081, }, { date: '30-06-2040', reinvested: 61198.6574909884, nonReinvested: 60666.4065802434, }, { date: '31-07-2040', reinvested: 61990.1241978039, nonReinvested: 61342.5490328557, }, { date: '31-08-2040', reinvested: 62403.431461915, nonReinvested: 61761.9859709891, }, { date: '30-09-2040', reinvested: 62814.5848701983, nonReinvested: 62172.8679392301, }, { date: '31-10-2040', reinvested: 63229.2045964781, nonReinvested: 62587.1448570587, }, { date: '30-11-2040', reinvested: 63645.2726636028, nonReinvested: 63002.8006749489, }, { date: '31-12-2040', reinvested: 64062.7947124431, nonReinvested: 63419.8403661559, }, { date: '31-01-2041', reinvested: 64481.7832206815, nonReinvested: 63838.275729601, }, { date: '28-02-2041', reinvested: 64902.2438535971, nonReinvested: 64258.1117708969, }, { date: '31-03-2041', reinvested: 65324.1822906926, nonReinvested: 64679.35351591, }, { date: '30-04-2041', reinvested: 65747.6042488403, nonReinvested: 65102.0060337843, }, { date: '31-05-2041', reinvested: 66172.5154593118, nonReinvested: 65526.0744139845, }, { date: '30-06-2041', reinvested: 66598.9216678607, nonReinvested: 65951.5637663324, }, { date: '31-07-2041', reinvested: 67443.6584310138, nonReinvested: 66663.8369011168, }, { date: '31-08-2041', reinvested: 67876.638081872, nonReinvested: 67104.0894666815, }, { date: '30-09-2041', reinvested: 68306.8705170031, nonReinvested: 67534.0024711365, }, { date: '31-10-2041', reinvested: 68740.8280047802, nonReinvested: 67967.5573526644, }, { date: '30-11-2041', reinvested: 69176.3099543582, nonReinvested: 68402.5559564252, }, { date: '31-12-2041', reinvested: 69613.3222380631, nonReinvested: 68839.0035363618, }, { date: '31-01-2042', reinvested: 70051.8781868127, nonReinvested: 69276.9127916409, }, { date: '28-02-2042', reinvested: 70491.9836965913, nonReinvested: 69716.2890085457, }, { date: '31-03-2042', reinvested: 70933.6446776621, nonReinvested: 70157.1374943095, }, { date: '30-04-2042', reinvested: 71376.8670798842, nonReinvested: 70599.4636022506, }, { date: '31-05-2042', reinvested: 71821.6568676638, nonReinvested: 71043.2727067004, }, { date: '30-06-2042', reinvested: 72268.0200200809, nonReinvested: 71488.5702030392, }, { date: '31-07-2042', reinvested: 73168.7823855149, nonReinvested: 72238.1283002486, }, { date: '31-08-2042', reinvested: 73622.5236584802, nonReinvested: 72700.4414433347, }, { date: '30-09-2042', reinvested: 74072.8382633091, nonReinvested: 73150.3829130399, }, { date: '31-10-2042', reinvested: 74527.1509814924, nonReinvested: 73604.2262017931, }, { date: '30-11-2042', reinvested: 74983.0689837743, nonReinvested: 74059.5815095696, }, { date: '31-12-2042', reinvested: 75440.5983633841, nonReinvested: 74516.4543899599, }, { date: '31-01-2043', reinvested: 75899.7533279288, nonReinvested: 74974.8584944265, }, { date: '28-02-2043', reinvested: 76360.5399944118, nonReinvested: 75434.7994085317, }, { date: '31-03-2043', reinvested: 76822.9644946452, nonReinvested: 75896.2827393936, }, { date: '30-04-2043', reinvested: 77287.0330028551, nonReinvested: 76359.3141430509, }, { date: '31-05-2043', reinvested: 77752.751708436, nonReinvested: 76823.8992971626, }, { date: '30-06-2043', reinvested: 78220.1268161194, nonReinvested: 77290.0439010455, }, { date: '31-07-2043', reinvested: 79179.8028071723, nonReinvested: 78078.0964221655, }, ]; for (let i = 0; i < canvases.length; i++) { const ctx = canvases[i].getContext('2d'); const labels = data.map((d) => d.date); const datasetReinvested = { label: 'Capital Post tax (Dividences réinvestis)', data: data.map((d) => d.reinvested), fill: false, backgroundColor: '#fdac02', borderWidth: 0, }; const datasetNonReinvested = { label: 'Capital Post tax (Dividendes non-réinvestis)', data: data.map((d) => d.nonReinvested), fill: false, backgroundColor: '#094036', borderWidth: 0, }; new Chart(ctx, { type: 'line', data: { labels: labels, datasets: [datasetReinvested, datasetNonReinvested], }, options: { responsive: true, maintainAspectRatio: false, plugins: { title: { display: true, text: 'Capital Constitué par la stratégie', font: { size: 16, // Remplacez par la taille que vous voulez }, padding: { bottom: 20, // Espacement en bas du titre }, }, tooltip: { callbacks: { label: function (context) { let label = context.dataset.label || ''; if (label) { label += ': '; } if (context.parsed.y !== null) { label += new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR', minimumFractionDigits: 0, }).format(context.parsed.y); } return label; }, }, }, }, legend: { labels: { usePointStyle: true, }, }, scales: { x: [ { type: 'time', time: { parser: 'DD-MM-YYYY', }, scaleLabel: { display: true, labelString: 'Date', }, }, ], y: { ticks: { callback: function (value, index, values) { return new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR', minimumFractionDigits: 0, }).format(value); }, }, scaleLabel: { display: true, labelString: 'Capital', }, }, }, }, }); } }); document.addEventListener('DOMContentLoaded', function () { // Fonction pour formater les valeurs au format français (avec le symbole d'euro et sans décimales) const formatCurrency = (value) => new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR', minimumFractionDigits: 0, maximumFractionDigits: 0, }).format(value); // Données du graphique const dates = [ '31-12-2023', '31-12-2024', '31-12-2025', '31-12-2026', '31-12-2027', '31-12-2028', '31-12-2029', '31-12-2030', '31-12-2031', '31-12-2032', '31-12-2033', '31-12-2034', '31-12-2035', '31-12-2036', '31-12-2037', '31-12-2038', '31-12-2039', '31-12-2040', '31-12-2041', '31-12-2042', '31-12-2043', ]; const capital = [ 0, 0, 0, 0, 0, -5565.586, -160.3374441, 5391.044735, 11092.78404, 16949.22907, 22964.85726, 29144.27873, 35419.21156, 41669.19492, 48119.49482, 54775.63572, 61643.30052, 68728.33515, 76036.75337, 83574.74177, 91348.66475, ]; // Fonction pour créer le graphique const createChart = () => { const canvases = document.getElementsByClassName('canvas-4'); for (let i = 0; i < canvases.length; i++) { const ctx = canvases[i].getContext('2d'); new Chart(ctx, { type: 'line', data: { labels: dates, datasets: [ { label: 'Capital SCPI à crédit sur 15 ans (3%)', data: capital, backgroundColor: '#fdac02', borderColor: '#fdac02', fill: false, }, ], }, options: { responsive: true, maintainAspectRatio: false, plugins: { tooltip: { callbacks: { label: function (context) { let label = context.dataset.label || ''; if (label) { label += ': '; } label += formatCurrency(context.parsed.y); return label; }, }, }, legend: { display: false, }, title: { display: true, text: 'Capital SCPI à crédit sur 15 ans (3%)', font: { size: 16, }, padding: { bottom: 20, }, }, }, interaction: { mode: 'nearest', axis: 'x', intersect: false, }, scales: { x: { title: { display: true, labelString: 'Date', }, }, y: { title: { display: true, labelString: 'Capital', }, ticks: { callback: function (value, index, values) { return formatCurrency(value); }, }, }, }, }, }); } }; createChart(); }); document.addEventListener('DOMContentLoaded', function () { const canvases = document.getElementsByClassName('canvas-5'); for (let i = 0; i < canvases.length; i++) { const ctx = canvases[i].getContext('2d'); const dates = [ '31-07-2023', '31-08-2023', '30-09-2023', '31-10-2023', '30-11-2023', '31-12-2023', '31-01-2024', '29-02-2024', '31-03-2024', '30-04-2024', '31-05-2024', '30-06-2024', '31-07-2024', '31-08-2024', '30-09-2024', '31-10-2024', '30-11-2024', '31-12-2024', '31-01-2025', '28-02-2025', '31-03-2025', '30-04-2025', '31-05-2025', '30-06-2025', '31-07-2025', '31-08-2025', '30-09-2025', '31-10-2025', '30-11-2025', '31-12-2025', '31-01-2026', '28-02-2026', '31-03-2026', '30-04-2026', '31-05-2026', '30-06-2026', '31-07-2026', '31-08-2026', '30-09-2026', '31-10-2026', '30-11-2026', '31-12-2026', '31-01-2027', '28-02-2027', '31-03-2027', '30-04-2027', '31-05-2027', '30-06-2027', '31-07-2027', '31-08-2027', '30-09-2027', '31-10-2027', '30-11-2027', '31-12-2027', '31-01-2028', '29-02-2028', '31-03-2028', '30-04-2028', '31-05-2028', '30-06-2028', '31-07-2028', '31-08-2028', '30-09-2028', '31-10-2028', '30-11-2028', '31-12-2028', '31-01-2029', '28-02-2029', '31-03-2029', '30-04-2029', '31-05-2029', '30-06-2029', '31-07-2029', '31-08-2029', '30-09-2029', '31-10-2029', '30-11-2029', '31-12-2029', '31-01-2030', '28-02-2030', '31-03-2030', '30-04-2030', '31-05-2030', '30-06-2030', '31-07-2030', '31-08-2030', '30-09-2030', '31-10-2030', '30-11-2030', '31-12-2030', '31-01-2031', '28-02-2031', '31-03-2031', '30-04-2031', '31-05-2031', '30-06-2031', '31-07-2031', '31-08-2031', '30-09-2031', '31-10-2031', '30-11-2031', '31-12-2031', '31-01-2032', '29-02-2032', '31-03-2032', '30-04-2032', '31-05-2032', '30-06-2032', '31-07-2032', '31-08-2032', '30-09-2032', '31-10-2032', '30-11-2032', '31-12-2032', '31-01-2033', '28-02-2033', '31-03-2033', '30-04-2033', '31-05-2033', '30-06-2033', '31-07-2033', '31-08-2033', '30-09-2033', '31-10-2033', '30-11-2033', '31-12-2033', '31-01-2034', '28-02-2034', '31-03-2034', '30-04-2034', '31-05-2034', '30-06-2034', '31-07-2034', '31-08-2034', '30-09-2034', '31-10-2034', '30-11-2034', '31-12-2034', '31-01-2035', '28-02-2035', '31-03-2035', '30-04-2035', '31-05-2035', '30-06-2035', '31-07-2035', '31-08-2035', '30-09-2035', '31-10-2035', '30-11-2035', '31-12-2035', '31-01-2036', '29-02-2036', '31-03-2036', '30-04-2036', '31-05-2036', '30-06-2036', '31-07-2036', '31-08-2036', '30-09-2036', '31-10-2036', '30-11-2036', '31-12-2036', '31-01-2037', '28-02-2037', '31-03-2037', '30-04-2037', '31-05-2037', '30-06-2037', '31-07-2037', '31-08-2037', '30-09-2037', '31-10-2037', '30-11-2037', '31-12-2037', '31-01-2038', '28-02-2038', '31-03-2038', '30-04-2038', '31-05-2038', '30-06-2038', '31-07-2038', '31-08-2038', '30-09-2038', '31-10-2038', '30-11-2038', '31-12-2038', '31-01-2039', '28-02-2039', '31-03-2039', '30-04-2039', '31-05-2039', '30-06-2039', '31-07-2039', '31-08-2039', '30-09-2039', '31-10-2039', '30-11-2039', '31-12-2039', '31-01-2040', '29-02-2040', '31-03-2040', '30-04-2040', '31-05-2040', '30-06-2040', '31-07-2040', '31-08-2040', '30-09-2040', '31-10-2040', '30-11-2040', '31-12-2040', '31-01-2041', '28-02-2041', '31-03-2041', '30-04-2041', '31-05-2041', '30-06-2041', '31-07-2041', '31-08-2041', '30-09-2041', '31-10-2041', '30-11-2041', '31-12-2041', '31-01-2042', '28-02-2042', '31-03-2042', '30-04-2042', '31-05-2042', '30-06-2042', '31-07-2042', '31-08-2042', '30-09-2042', '31-10-2042', '30-11-2042', '31-12-2042', '31-01-2043', '28-02-2043', '31-03-2043', '30-04-2043', '31-05-2043', '30-06-2043', '31-07-2043', ]; const capital = [ 200.0, 400.0, 600.0, 800.0, 1001.3471727666318, 1203.3679293837426, 1406.0622749971603, 1609.4347570197579, 1813.487659505942, 2018.2232717848417, 2223.643903806318, 2429.7518785643188, 2651.4317370489434, 2858.9264963215696, 3067.1117495346048, 3276.072318903369, 3485.7319949371945, 3696.0931599842597, 3907.158474614143, 4118.930348272583, 4331.411204070401, 4544.603479756367, 4758.509626904481, 4973.132110991012, 5218.984714431263, 5435.06829617187, 5651.856278616177, 5869.531581956409, 6087.935556584764, 6307.070731796201, 6526.940194443093, 6747.546502643872, 6968.892229005484, 7190.979962521619, 7413.812306806976, 7637.391880160031, 7908.652439873205, 8133.780866186697, 8359.6159050564, 8586.456369284439, 8814.056913911783, 9042.420225426906, 9271.549841762257, 9501.448479792445, 9732.118871636301, 9963.563767529062, 10195.78593305145, 10428.788149176546, 10726.756298534186, 10961.411330270786, 11196.7613118703, 11433.24126541939, 11670.51466933402, 11908.584377652145, 12147.454405081906, 12387.127637421809, 12627.606976386636, 12868.895343505434, 13110.995676290931, 13353.91092826929, 13679.951821807414, 13724.600077424953, 13769.954344245421, 13816.570171220377, 13863.340178668266, 13910.267178895505, 13957.355464365213, 14004.605590439201, 14052.018122147994, 14099.593639193512, 14147.332723334144, 14195.235958418058, 14331.038467215516, 14379.290986778475, 14427.652868696283, 14476.6454045543, 14525.804915395594, 14575.131998509421, 14624.628820542635, 14674.295982962396, 14724.13408944121, 14774.143751159096, 14824.32558151883, 14874.680196154102, 15017.39992511488, 15068.128119683844, 15118.957163682391, 15170.449266737567, 15222.117097593724, 15273.961286116672, 15325.984111691338, 15378.18620846507, 15430.568212911205, 15483.130769402964, 15535.87452465756, 15588.800127744778, 15738.790114631973, 15792.126119253717, 15845.54839154817, 15899.667806181104, 15953.972171035895, 16008.462150233996, 16063.140141777441, 16118.006814279335, 16173.062838805246, 16228.308894733078, 16283.74566391217, 16339.37383067233, 16497.005589874905, 16553.08503543467, 16609.233450638807, 16666.114863347288, 16723.190946461626, 16780.462400224656, 16837.93174747221, 16895.59969316427, 16953.466944846175, 17011.534218809327, 17069.802233950497, 17128.271711781337, 17293.93585436393, 17352.90157507781, 17411.91592112673, 17471.70098569413, 17531.690966694496, 17591.88660245767, 17652.290547190478, 17712.90354417496, 17773.72633941815, 17834.759688129197, 17896.004348263345, 17957.46108053194, 18131.568311135918, 18193.570742334687, 18255.59804181178, 18318.43574579286, 18381.489167843665, 18444.759086443097, 18508.248294041365, 18571.957574314416, 18635.887713809836, 18700.03950875687, 18764.413758278675, 18829.01126440289, 19011.993427324775, 19077.191024813936, 19142.38591581151, 19208.432966833818, 19274.70712472552, 19341.209210275167, 19407.942161398958, 19474.906804337414, 19542.103968356732, 19609.53449290898, 19677.199220495433, 19745.09899667765, 19937.410177572234, 20005.969861336253, 20074.49499895521, 20143.91623197119, 20213.576581272006, 20283.47691221674, 20353.620315775614, 20424.00766302495, 20494.639828228574, 20565.517696366365, 20636.64215563051, 20708.014097437182, 20910.131783705234, 20982.229407439678, 21054.25588709655, 21127.22469377299, 21200.44528223816, 21273.91856478392, 21347.647793403303, 21421.633886381453, 21495.877765360972, 21570.380363258097, 21645.142616372737, 21720.16546440078, 21932.591767497008, 22008.41261554982, 22084.120419328327, 22160.819200830076, 22237.78312333301, 22315.013148525722, 22392.512697789178, 22470.282739092487, 22548.3242439409, 22626.63819569973, 22705.22558129811, 22784.087391241927, 23007.35033432541, 23087.089647726647, 23166.668115084867, 23247.28875958447, 23328.18863790946, 23409.36876371031, 23490.832736532742, 23572.581576606783, 23654.616307886525, 23736.93796680311, 23819.54759354098, 23902.446232051487, 24137.101106598646, 24220.96463996089, 24304.61296418328, 24389.35735050773, 24474.39583942372, 24559.729499208377, 24645.362116775974, 24731.294767294763, 24817.528529854895, 24904.06449667295, 24990.903763918297, 25078.047431727453, 25324.678226937107, 25412.882838117755, 25500.8105899844, 25589.891118894408, 25679.2814400141, 25768.9826790087, 25858.998819806813, 25949.330995289885, 26039.980342469862, 26130.948012168876, 26222.23515937223, 26313.84294324348, 26573.063852285904, 26665.838126816736, 26758.26580705021, 26851.905961736935, 26945.87246675523, 27040.16650801211, 27134.792276552802, 27229.750965840445, 27325.043773689093, 27420.671912443402, 27516.636598833436, 27612.939053990554, 27885.396061387728, ]; new Chart(ctx, { type: 'line', data: { labels: dates, datasets: [ { label: 'Capital SCPI à crédit sur 15 ans (3%)', data: capital, backgroundColor: '#fdac02', borderColor: '#fdac02', fill: false, }, ], }, options: { responsive: true, maintainAspectRatio: false, plugins: { tooltip: { callbacks: { label: function (context) { let label = new Intl.NumberFormat('fr-FR').format(context.parsed.y) + ' €'; if (context.parsed.x !== null && dates[context.parsed.x]) { label = dates[context.parsed.x] + ': ' + label; } return label; }, }, }, legend: { display: false, }, title: { display: true, text: 'Capital Investissement Versements programmés pendant 5 ans', font: { size: 16, }, padding: { bottom: 20, }, }, }, interaction: { mode: 'nearest', axis: 'x', intersect: false, }, scales: { x: { title: { display: true, labelString: 'Date', }, }, y: { title: { display: true, labelString: 'Capital', }, ticks: { callback: function (value, index, values) { return new Intl.NumberFormat('fr-FR').format(value) + ' €'; }, }, }, }, }, }); } }); document.addEventListener('DOMContentLoaded', function () { // Fonction pour formater les valeurs au format français (avec le symbole d'euro et sans décimales) const formatCurrency = (value) => new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR', minimumFractionDigits: 0, maximumFractionDigits: 0, }).format(value); // Données du graphique const dates = [ '31-12-2023', '31-12-2024', '31-12-2025', '31-12-2026', '31-12-2027', '31-12-2028', '31-12-2029', '31-12-2030', '31-12-2031', '31-12-2032', '31-12-2033', '31-12-2034', '31-12-2035', '31-12-2036', '31-12-2037', '31-12-2038', '31-12-2039', '31-12-2040', '31-12-2041', '31-12-2042', '31-12-2043', ]; const capital = [ 0, 0, 0, 0, 0, -5565.586, -160.3374441, 5391.044735, 11092.78404, 16949.22907, 22964.85726, 29144.27873, 35419.21156, 41669.19492, 48119.49482, 54775.63572, 61643.30052, 68728.33515, 76036.75337, 83574.74177, 91348.66475, ]; // Fonction pour créer le graphique const createChart = () => { const canvases = document.getElementsByClassName('canvas-6'); for (let i = 0; i < canvases.length; i++) { const ctx = canvases[i].getContext('2d'); new Chart(ctx, { type: 'line', data: { labels: dates, datasets: [ { label: 'Capital SCPI à crédit sur 15 ans (3%)', data: capital, backgroundColor: '#fdac02', borderColor: '#fdac02', fill: false, }, ], }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false, }, title: { display: true, text: 'Capital Généré (Approche mixte 3%)', font: { size: 16, }, padding: { bottom: 20, }, }, tooltip: { callbacks: { label: function (context) { const value = context.parsed.y; return formatCurrency(value); }, }, }, }, interaction: { mode: 'nearest', axis: 'x', intersect: false, }, scales: { x: { title: { display: true, labelString: 'Date', }, }, y: { title: { display: true, labelString: 'Capital', }, ticks: { callback: function (value) { return formatCurrency(value); }, // Supprimer les zéros inutiles sur l'axe vertical precision: 0, }, }, }, }, }); } }; createChart(); }); document.addEventListener('DOMContentLoaded', function () { const canvases = document.getElementsByClassName('canvas-7'); for (let i = 0; i < canvases.length; i++) { const ctx = canvases[i].getContext('2d'); // Les données pour le graphique const data7 = { labels: ['Mixte 3%', 'Mixte 4%', 'Mixte 4.5%', 'Crédit 4.99%'], datasets: [ { label: "Capital Final Généré par l'investissement", data: [119234.0608, 105988.6053, 100413.4372, 115874.5439], backgroundColor: '#fdac02', }, ], }; new Chart(ctx, { type: 'bar', data: data7, options: { indexAxis: 'x', // Utilise l'axe x comme axe des catégories responsive: true, maintainAspectRatio: false, interaction: { mode: 'nearest', axis: 'x', intersect: false, }, plugins: { tooltip: { callbacks: { label: function (context) { let label = context.dataset.label || ''; if (label) { label += ': '; } if (context.parsed.y !== null) { label += new Intl.NumberFormat('fr-FR').format(context.parsed.y) + ' €'; } return label; }, }, }, legend: { display: false, }, title: { display: true, text: "Capital Final Généré par l'investissement", font: { size: 16, }, padding: { bottom: 20, }, }, }, scales: { x: { ticks: { callback: function (value, index, values) { return data7.labels[index]; // Affiche les labels spécifiés dans le tableau labels }, }, title: { display: false, // Retire le titre de l'axe horizontal }, }, y: { ticks: { callback: function (value, index, values) { return new Intl.NumberFormat('fr-FR').format(value) + ' €'; // Formattage des chiffres de l'axe vertical en français }, stepSize: 5000, min: 100000, max: 140000, }, title: { display: false, // Retire le titre de l'axe vertical }, }, }, }, }); } }); document.addEventListener('DOMContentLoaded', function () { const canvases = document.getElementsByClassName('canvas-8'); for (let i = 0; i < canvases.length; i++) { // On prépare les données pour le graphique const data8 = { labels: [1, 3, 3.5, 4, 4.5], datasets: [ { label: 'Capital Approche Mixte', data: [138686.8028, 119234.0608, 111982.7924, 105988.6053, 100413.4372], borderColor: '#fdac02', backgroundColor: 'rgba(253, 172, 2, 0.2)', // Couleur de fond pour la ligne borderWidth: 2, // Epaisseur du trait fill: false, }, { label: 'Capital SCPI Versements Programmés', data: [114081.9479, 114081.9479, 114081.9479, 114081.9479, 114081.9479], borderColor: '#094036', backgroundColor: 'rgba(9, 64, 54, 0.2)', // Couleur de fond pour la ligne borderWidth: 2, // Epaisseur du trait fill: false, }, { label: 'Capital SCPI à Crédit 4.99%', data: [115874.5439, 115874.5439, 115874.5439, 115874.5439, 115874.5439], borderColor: '#1dac92', backgroundColor: 'rgba(29, 172, 146, 0.2)', // Couleur de fond pour la ligne borderWidth: 2, // Epaisseur du trait fill: false, }, ], }; const ctx = canvases[i].getContext('2d'); const chart = new Chart(ctx, { type: 'line', data: data8, options: { responsive: true, maintainAspectRatio: false, plugins: { title: { display: true, text: "Capital Généré par l'approche mixte en fonction du taux dans 5 ans", font: { size: 16, }, padding: { bottom: 20, }, }, }, scales: { x: { ticks: { callback: function (value, index, values) { return value + '%'; // Formater les nombres avec 4 décimales }, }, }, y: { title: { display: false, }, ticks: { callback: function (value, index, values) { return new Intl.NumberFormat('fr-FR').format(value) + ' €'; }, stepSize: 5000, min: 100000, max: 140000, }, }, }, interaction: { mode: 'index', // Mode de survol pour afficher les informations du tooltip }, }, }); } }); document.addEventListener('DOMContentLoaded', function () { // Fonction pour formater les valeurs en pourcentage const formatPercentage = (value) => new Intl.NumberFormat('fr-FR', { style: 'percent', minimumFractionDigits: 2, maximumFractionDigits: 2, }).format(value); // Données du graphique const rawData = [ ['2012-12-31', 0.02464993735], ['2013-06-30', 0.02342253281], ['2013-12-31', 0.02775146595], ['2014-06-30', 0.03107573671], ['2014-12-31', 0.03257560343], ['2015-06-30', 0.03421582737], ['2015-12-31', 0.03129763278], ['2016-06-30', 0.02789108455], ['2016-12-31', 0.0312417116], ['2017-06-30', 0.03348740764], ['2017-12-31', 0.03084322847], ['2018-06-30', 0.02804239833], ['2018-12-31', 0.02770728582], ['2019-06-30', 0.02814913165], ['2019-12-31', 0.02738786599], ['2020-06-30', 0.02545310222], ['2020-12-31', 0.02430295173], ['2021-06-30', 0.02318526586], ['2021-12-31', 0.02257057044], ['2022-06-30', 0.02489324457], ['2022-12-31', 0.02403092124], ['2023-06-30', -0.01107329773], ]; const dates = rawData.map((entry) => { const [year, month, day] = entry[0].split('-'); return `${day}-${month}-${year}`; }); const values = rawData.map((entry) => entry[1]); // Calcul de la performance moyenne const averagePerformance = values.reduce((sum, value) => sum + value, 0) / values.length; // Fonction pour créer le graphique const createChart = () => { const canvases = document.getElementsByClassName('canvas-10'); for (let i = 0; i < canvases.length; i++) { const ctx = canvases[i].getContext('2d'); new Chart(ctx, { type: 'bar', data: { labels: dates, datasets: [ { label: 'Performance moyenne', data: Array(dates.length).fill(averagePerformance), // Remplir le tableau avec la valeur moyenne type: 'line', // Type de graphique pour la performance moyenne borderColor: 'red', borderWidth: 2, borderDash: [5, 5], // Pour rendre la ligne pointillée fill: false, pointRadius: 0, // Pour cacher les points sur la ligne }, { label: '6M performance', data: values, backgroundColor: '#fdac02', borderColor: '#fdac02', fill: false, }, ], }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: true, }, tooltip: { callbacks: { label: function (context) { const value = context.parsed.y; return formatPercentage(value); }, }, }, }, interaction: { mode: 'nearest', axis: 'x', intersect: false, }, scales: { x: { title: { display: true, labelString: 'Date', }, }, y: { title: { display: true, labelString: 'Performance', }, ticks: { callback: function (value) { return formatPercentage(value); }, precision: 2, }, }, }, }, }); } }; createChart(); });