طلا امروز با افزایش ۳٫۵۴ درصدی، از ۲۴٬۴۰۱٬۲۰۰ (بیست و چهار میلیون و چهارصد و یک هزار و دویست ) تومان به ۲۵٬۲۶۵٬۵۰۰تومان رسید. .ecodata-widget { width: 100%; font-family: IRANYekan, sans-serif; --ecodata-background: #ffffff; --ecodata-h1: #111827; --ecodata-labels: #374151; --ecodata-border: #c4c4c4; --ecodata-stroke: #013b82; } /* Dark theme */ html.dark .ecodata-widget, .dark .ecodata-widget, [class*="dark"] .ecodata-widget { --ecodata-background: #1f2937; --ecodata-h1: #f3f4f6; --ecodata-labels: #9ca3af; --ecodata-border: #4b5563; --ecodata-stroke: #013b82; } .widget-title { font-size: 1.875rem; font-weight: 700; color: var(--ecodata-h1); margin-bottom: 1rem; } .chart-container { width: 100%; overflow-x: auto; margin-top: 35px; } #chartdiv { width: 100%; height: 400px; min-width: 600px; } .filter-buttons { display: flex; gap: 1rem; justify-content: center; margin-top: 1.875rem; flex-wrap: wrap; } @media (max-width: 600px) { .filter-buttons { align-items: center; } } .filter-btn { padding: 0.5rem 1.5rem; border-radius: 0.5rem; font-weight: 500; font-family: IRANYekan, sans-serif; transition: all 0.2s; cursor: pointer; border: 1px solid var(--ecodata-border); background-color: var(--ecodata-background); color: var(--ecodata-h1); } /* Light mode hover and active - explicit selectors */ html:not(.dark) .filter-btn:hover, :not(.dark) .filter-btn:hover, :not([class*="dark"]) .filter-btn:hover { background-color: #f3f4f6; color: var(--ecodata-h1); } html:not(.dark) .filter-btn.active, :not(.dark) .filter-btn.active, :not([class*="dark"]) .filter-btn.active { background-color: #f3f4f6; color: var(--ecodata-h1); } /* Fallback for light mode when no dark class is present */ .filter-btn:hover { background-color: #f3f4f6; color: var(--ecodata-h1); } .filter-btn.active { background-color: #f3f4f6; color: var(--ecodata-h1); } /* Dark mode hover and active - override light mode styles */ html.dark .filter-btn:hover, .dark .filter-btn:hover, [class*="dark"] .filter-btn:hover { background-color: #111827; color: var(--ecodata-h1); } html.dark .filter-btn.active, .dark .filter-btn.active, [class*="dark"] .filter-btn.active { background-color: #111827; color: var(--ecodata-h1); } .ecodata-table-container { margin-top: 2rem; width: 100%; font-family: IRANYekan, sans-serif; } .ecodata-table-container table { width: 100%; min-width: 600px; border-collapse: collapse; } .ecodata-table-container th, .ecodata-table-container td { padding: 0.75rem; border-left: 1px solid var(--ecodata-border); border-bottom: 1px solid var(--ecodata-border); border-right: 1px solid var(--ecodata-border); border-top: 1px solid var(--ecodata-border); } .ecodata-table-container th { background-color: var(--ecodata-background); white-space: nowrap; } .ecodata-table-container tbody tr:nth-child(even) { background-color: transparent; } .ecodata-table-container tbody tr:nth-child(odd) { background-color: var(--ecodata-background); } .sort-btn { color: var(--ecodata-h1); background: transparent; border: none; cursor: pointer; width: 100%; padding: 0; font-family: IRANYekan, sans-serif; } .sort-btn:hover { opacity: 0.7; } .table-wrapper { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; border-radius: 0.375rem; } .table-header-name { text-align: right; } .table-header-center { text-align: center; } .table-cell-name { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .table-cell-center { text-align: center; font-family: IRANYekan, sans-serif; } .sparkline-container { display: flex; justify-content: center; align-items: center; } .ecodata-widget-donya { margin-bottom: 10px; border-bottom: 1px dotted #ccc; padding-bottom: 20px; } قیمت طلا امروز ۷ مهر ۱۴۰۵ (گرم، مثقال 18 عیار و اونس جهانی) قیمت گرم طلای ۱۸ عیار شاهد افزایش ۳٫۵۴% درصدی قیمت بوده است بطوری که گرم طلای ۱۸ عیار که روز قبل تا ۲۴٬۴۰۱٬۲۰۰ تومان رسیده بود، امروز ۷ مهر ۱۴۰۵ به ۲۵٬۲۶۵٬۵۰۰ تومان رسید. عنوان قیمت تغییرات نسبت به روز قبل تغییرات نسبت به هفته قبل نوسان 7 روز گذشته آخرین بروزرسانی گرم طلای ۱۸ عیار ۲۵٬۲۶۵٬۵۰۰ ۳٫۵۴% ۶٫۳۱% ۲۲:۳۵ مثقال طلا ۱۸ عیار ۱۰۹٬۴۴۸٬۰۰۰ ۳٫۵۴% ۶٫۳۱% ۲۲:۳۵ اونس طلای جهانی ۴۱۷٫۱۲۱ ۱٫۱۸% −۲٫۶۳% ۲۲:۳۵ سکه امامی ۲۵۵٬۰۱۰٬۰۰۰ ۳٫۲۵% ۷٫۸۴% ۲۲:۳۵ سکه بهار آزادی ۲۴۶٬۵۰۰٬۰۰۰ ۲٫۳۷% ۶٫۱۵% ۲۲:۳۵ نیم سکه ۱۳۲٬۰۰۰٬۰۰۰ ۳٫۹۴% ۸٫۶۴% ۲۲:۳۵ ربع سکه ۷۱٬۰۰۰٬۰۰۰ ۴٫۴۱% ۱۰٫۹۴% ۲۲:۳۵ سکه گرمی ۳۷٬۰۰۰٬۰۰۰ ۲٫۷۸% ۸٫۸۲% ۲۲:۳۰ همه یک سال یک ماه یک هفته [{"date":"۱۴۰۴/۰۶/۰۶","price":8410360},{"date":"۱۴۰۴/۰۶/۰۷","price":8620434},{"date":"۱۴۰۴/۰۶/۰۸","price":8677455},{"date":"۱۴۰۴/۰۶/۰۹","price":8931852},{"date":"۱۴۰۴/۰۶/۱۰","price":8957246},{"date":"۱۴۰۴/۰۶/۱۱","price":8760561},{"date":"۱۴۰۴/۰۶/۱۲","price":8698000},{"date":"۱۴۰۴/۰۶/۱۳","price":8527171},{"date":"۱۴۰۴/۰۶/۱۴","price":8669606},{"date":"۱۴۰۴/۰۶/۱۵","price":8724317},{"date":"۱۴۰۴/۰۶/۱۶","price":8824968},{"date":"۱۴۰۴/۰۶/۱۷","price":8871831},{"date":"۱۴۰۴/۰۶/۱۸","price":8839974},{"date":"۱۴۰۴/۰۶/۱۹","price":8698924},{"date":"۱۴۰۴/۰۶/۲۰","price":8665450},{"date":"۱۴۰۴/۰۶/۲۱","price":8641904},{"date":"۱۴۰۴/۰۶/۲۲","price":8534327},{"date":"۱۴۰۴/۰۶/۲۳","price":8456299},{"date":"۱۴۰۴/۰۶/۲۴","price":8678378},{"date":"۱۴۰۴/۰۶/۲۵","price":8856133},{"date":"۱۴۰۴/۰۶/۲۶","price":8891915},{"date":"۱۴۰۴/۰۶/۲۷","price":8818735},{"date":"۱۴۰۴/۰۶/۲۸","price":9020499},{"date":"۱۴۰۴/۰۶/۲۹","price":9292441},{"date":"۱۴۰۴/۰۶/۳۰","price":9532988},{"date":"۱۴۰۴/۰۶/۳۱","price":9440417},{"date":"۱۴۰۴/۰۷/۰۱","price":9646798},{"date":"۱۴۰۴/۰۷/۰۲","price":9966295},{"date":"۱۴۰۴/۰۷/۰۳","price":9941363},{"date":"۱۴۰۴/۰۷/۰۴","price":10103421},{"date":"۱۴۰۴/۰۷/۰۵","price":10361050},{"date":"۱۴۰۴/۰۷/۰۶","price":10209843},{"date":"۱۴۰۴/۰۷/۰۷","price":10451775},{"date":"۱۴۰۴/۰۷/۰۸","price":10625836},{"date":"۱۴۰۴/۰۷/۰۹","price":10922941},{"date":"۱۴۰۴/۰۷/۱۰","price":10974421},{"date":"۱۴۰۴/۰۷/۱۱","price":11057528},{"date":"۱۴۰۴/۰۷/۱۲","price":10896855},{"date":"۱۴۰۴/۰۷/۱۳","price":10573664},{"date":"۱۴۰۴/۰۷/۱۴","price":10495867},{"date":"۱۴۰۴/۰۷/۱۵","price":10928251},{"date":"۱۴۰۴/۰۷/۱۶","price":11332009},{"date":"۱۴۰۴/۰۷/۱۷","price":10750034},{"date":"۱۴۰۴/۰۷/۱۸","price":10902857},{"date":"۱۴۰۴/۰۷/۱۹","price":10925481},{"date":"۱۴۰۴/۰۷/۲۰","price":10800821},{"date":"۱۴۰۴/۰۷/۲۱","price":10895470},{"date":"۱۴۰۴/۰۷/۲۲","price":10801976},{"date":"۱۴۰۴/۰۷/۲۳","price":11118703},{"date":"۱۴۰۴/۰۷/۲۴","price":11382104},{"date":"۱۴۰۴/۰۷/۲۵","price":11069070},{"date":"۱۴۰۴/۰۷/۲۶","price":10905397},{"date":"۱۴۰۴/۰۷/۲۷","price":11118472},{"date":"۱۴۰۴/۰۷/۲۸","price":10981116},{"date":"۱۴۰۴/۰۷/۲۹","price":10637148},{"date":"۱۴۰۴/۰۷/۳۰","price":10910476},{"date":"۱۴۰۴/۰۸/۰۱","price":10973036},{"date":"۱۴۰۴/۰۸/۰۲","price":10796666},{"date":"۱۴۰۴/۰۸/۰۳","price":10698554},{"date":"۱۴۰۴/۰۸/۰۴","price":10787894},{"date":"۱۴۰۴/۰۸/۰۵","price":10567662},{"date":"۱۴۰۴/۰۸/۰۶","price":10395447},{"date":"۱۴۰۴/۰۸/۰۷","price":10499099},{"date":"۱۴۰۴/۰۸/۰۸","price":10508795},{"date":"۱۴۰۴/۰۸/۰۹","price":10426150},{"date":"۱۴۰۴/۰۸/۱۰","price":10532111},{"date":"۱۴۰۴/۰۸/۱۱","price":10543653},{"date":"۱۴۰۴/۰۸/۱۲","price":10482478},{"date":"۱۴۰۴/۰۸/۱۳","price":10399372},{"date":"۱۴۰۴/۰۸/۱۴","price":10509487},{"date":"۱۴۰۴/۰۸/۱۵","price":10395216},{"date":"۱۴۰۴/۰۸/۱۶","price":10457084},{"date":"۱۴۰۴/۰۸/۱۷","price":10449697},{"date":"۱۴۰۴/۰۸/۱۸","price":10449697},{"date":"۱۴۰۴/۰۸/۱۹","price":10681933},{"date":"۱۴۰۴/۰۸/۲۰","price":11060990},{"date":"۱۴۰۴/۰۸/۲۱","price":11520153},{"date":"۱۴۰۴/۰۸/۲۲","price":11425966},{"date":"۱۴۰۴/۰۸/۲۳","price":11214506},{"date":"۱۴۰۴/۰۸/۲۴","price":11292072},{"date":"۱۴۰۴/۰۸/۲۵","price":11113393},{"date":"۱۴۰۴/۰۸/۲۶","price":11207581},{"date":"۱۴۰۴/۰۸/۲۷","price":11211505},{"date":"۱۴۰۴/۰۸/۲۸","price":11364328},{"date":"۱۴۰۴/۰۸/۲۹","price":11316542},{"date":"۱۴۰۴/۰۸/۳۰","price":11324160},{"date":"۱۴۰۴/۰۹/۰۱","price":11134632},{"date":"۱۴۰۴/۰۹/۰۲","price":11325776},{"date":"۱۴۰۴/۰۹/۰۳","price":11304307},{"date":"۱۴۰۴/۰۹/۰۴","price":11363867},{"date":"۱۴۰۴/۰۹/۰۵","price":11512073},{"date":"۱۴۰۴/۰۹/۰۶","price":11535620},{"date":"۱۴۰۴/۰۹/۰۷","price":11679440},{"date":"۱۴۰۴/۰۹/۰۸","price":11819336},{"date":"۱۴۰۴/۰۹/۰۹","price":11961771},{"date":"۱۴۰۴/۰۹/۱۰","price":12142065},{"date":"۱۴۰۴/۰۹/۱۱","price":12140218},{"date":"۱۴۰۴/۰۹/۱۲","price":12263954},{"date":"۱۴۰۴/۰۹/۱۳","price":12302968},{"date":"۱۴۰۴/۰۹/۱۴","price":12367606},{"date":"۱۴۰۴/۰۹/۱۵","price":12544900},{"date":"۱۴۰۴/۰۹/۱۶","price":12661249},{"date":"۱۴۰۴/۰۹/۱۷","price":12733505},{"date":"۱۴۰۴/۰۹/۱۸","price":12665173},{"date":"۱۴۰۴/۰۹/۱۹","price":12676254},{"date":"۱۴۰۴/۰۹/۲۰","price":12954430},{"date":"۱۴۰۴/۰۹/۲۱","price":13070548},{"date":"۱۴۰۴/۰۹/۲۲","price":13303938},{"date":"۱۴۰۴/۰۹/۲۳","price":13568262},{"date":"۱۴۰۴/۰۹/۲۴","price":13580497},{"date":"۱۴۰۴/۰۹/۲۵","price":13469920},{"date":"۱۴۰۴/۰۹/۲۶","price":13860519},{"date":"۱۴۰۴/۰۹/۲۷","price":13754790},{"date":"۱۴۰۴/۰۹/۲۸","price":13923542},{"date":"۱۴۰۴/۰۹/۲۹","price":13807424},{"date":"۱۴۰۴/۰۹/۳۰","price":13622281},{"date":"۱۴۰۴/۱۰/۰۱","price":13941086},{"date":"۱۴۰۴/۱۰/۰۲","price":14259661},{"date":"۱۴۰۴/۱۰/۰۳","price":14475045},{"date":"۱۴۰۴/۱۰/۰۴","price":14322683},{"date":"۱۴۰۴/۱۰/۰۵","price":14604783},{"date":"۱۴۰۴/۱۰/۰۶","price":15166905},{"date":"۱۴۰۴/۱۰/۰۷","price":15779814},{"date":"۱۴۰۴/۱۰/۰۸","price":14101989},{"date":"۱۴۰۴/۱۰/۰۹","price":14673576},{"date":"۱۴۰۴/۱۰/۱۰","price":14117687},{"date":"۱۴۰۴/۱۰/۱۱","price":14058359},{"date":"۱۴۰۴/۱۰/۱۲","price":14213952},{"date":"۱۴۰۴/۱۰/۱۳","price":14408559},{"date":"۱۴۰۴/۱۰/۱۴","price":14673576},{"date":"۱۴۰۴/۱۰/۱۵","price":15691629},{"date":"۱۴۰۴/۱۰/۱۶","price":16171799},{"date":"۱۴۰۴/۱۰/۱۷","price":16030749},{"date":"۱۴۰۴/۱۰/۱۸","price":15895932},{"date":"۱۴۰۴/۱۰/۲۸","price":15970266},{"date":"۱۴۰۴/۱۱/۰۳","price":17010711},{"date":"۱۴۰۴/۱۱/۰۴","price":16760469},{"date":"۱۴۰۴/۱۱/۰۵","price":16483400},{"date":"۱۴۰۴/۱۱/۰۶","price":17084100},{"date":"۱۴۰۴/۱۱/۰۷","price":18272500},{"date":"۱۴۰۴/۱۱/۰۸","price":20082900},{"date":"۱۴۰۴/۱۱/۰۹","price":20614100},{"date":"۱۴۰۴/۱۱/۱۰","price":20614100},{"date":"۱۴۰۴/۱۱/۱۱","price":19944400},{"date":"۱۴۰۴/۱۱/۱۲","price":18883100},{"date":"۱۴۰۴/۱۱/۱۳","price":17658900},{"date":"۱۴۰۴/۱۱/۱۴","price":19235400},{"date":"۱۴۰۴/۱۱/۱۵","price":19235400},{"date":"۱۴۰۴/۱۱/۱۶","price":19358000},{"date":"۱۴۰۴/۱۱/۱۷","price":19358000},{"date":"۱۴۰۴/۱۱/۱۸","price":18100600},{"date":"۱۴۰۴/۱۱/۱۹","price":18780400},{"date":"۱۴۰۴/۱۱/۲۰","price":19336100},{"date":"۱۴۰۴/۱۱/۲۱","price":19951500},{"date":"۱۴۰۴/۱۱/۲۲","price":19951500},{"date":"۱۴۰۴/۱۱/۲۳","price":19529700},{"date":"۱۴۰۴/۱۱/۲۴","price":19529700},{"date":"۱۴۰۴/۱۱/۲۵","price":18583000},{"date":"۱۴۰۴/۱۱/۲۶","price":19179800},{"date":"۱۴۰۴/۱۱/۲۷","price":18695500},{"date":"۱۴۰۴/۱۱/۲۸","price":18845500},{"date":"۱۴۰۴/۱۱/۲۹","price":19426800},{"date":"۱۴۰۴/۱۱/۳۰","price":19884600},{"date":"۱۴۰۴/۱۲/۰۱","price":19884600},{"date":"۱۴۰۴/۱۲/۰۲","price":19679100},{"date":"۱۴۰۴/۱۲/۰۳","price":19634800},{"date":"۱۴۰۴/۱۲/۰۴","price":19892900},{"date":"۱۴۰۴/۱۲/۰۵","price":19802800},{"date":"۱۴۰۴/۱۲/۰۶","price":20440900},{"date":"۱۴۰۴/۱۲/۰۷","price":20045200},{"date":"۱۴۰۴/۱۲/۰۸","price":20045200},{"date":"۱۴۰۴/۱۲/۰۹","price":20124400},{"date":"۱۴۰۴/۱۲/۱۰","price":20123700},{"date":"۱۴۰۴/۱۲/۱۱","price":20122300},{"date":"۱۴۰۴/۱۲/۱۲","price":20122300},{"date":"۱۴۰۴/۱۲/۱۳","price":20123700},{"date":"۱۴۰۴/۱۲/۱۴","price":20122600},{"date":"۱۴۰۴/۱۲/۱۵","price":20122600},{"date":"۱۴۰۴/۱۲/۱۶","price":20123000},{"date":"۱۴۰۴/۱۲/۱۷","price":20124000},{"date":"۱۴۰۴/۱۲/۱۸","price":20123700},{"date":"۱۴۰۴/۱۲/۱۹","price":20124200},{"date":"۱۴۰۴/۱۲/۲۰","price":20123500},{"date":"۱۴۰۴/۱۲/۲۱","price":20122800},{"date":"۱۴۰۴/۱۲/۲۲","price":20122800},{"date":"۱۴۰۴/۱۲/۲۳","price":20122600},{"date":"۱۴۰۴/۱۲/۲۴","price":20122300},{"date":"۱۴۰۴/۱۲/۲۸","price":17639264.2},{"date":"۱۴۰۴/۱۲/۲۹","price":17639264.2},{"date":"۱۴۰۵/۰۱/۰۱","price":17639264.2},{"date":"۱۴۰۵/۰۱/۰۲","price":17639264.2},{"date":"۱۴۰۵/۰۱/۰۳","price":17429900},{"date":"۱۴۰۵/۰۱/۰۴","price":17429900},{"date":"۱۴۰۵/۰۱/۰۵","price":17499600},{"date":"۱۴۰۵/۰۱/۰۶","price":17493600},{"date":"۱۴۰۵/۰۱/۰۷","price":17491200},{"date":"۱۴۰۵/۰۱/۰۸","price":17490700},{"date":"۱۴۰۵/۰۱/۰۹","price":17489300},{"date":"۱۴۰۵/۰۱/۱۰","price":17490500},{"date":"۱۴۰۵/۰۱/۱۱","price":17489300},{"date":"۱۴۰۵/۰۱/۱۹","price":17984000},{"date":"۱۴۰۵/۰۱/۲۰","price":18030100},{"date":"۱۴۰۵/۰۱/۲۲","price":17636290},{"date":"۱۴۰۵/۰۱/۲۳","price":17926700},{"date":"۱۴۰۵/۰۱/۲۴","price":18060600},{"date":"۱۴۰۵/۰۱/۲۵","price":18075200},{"date":"۱۴۰۵/۰۱/۲۶","price":17649700},{"date":"۱۴۰۵/۰۱/۲۷","price":17527800},{"date":"۱۴۰۵/۰۱/۲۹","price":16927800},{"date":"۱۴۰۵/۰۱/۳۰","price":17199300},{"date":"۱۴۰۵/۰۱/۳۱","price":17030300},{"date":"۱۴۰۵/۰۲/۰۱","price":16965600},{"date":"۱۴۰۵/۰۲/۰۲","price":17291000},{"date":"۱۴۰۵/۰۲/۰۳","price":17199300},{"date":"۱۴۰۵/۰۲/۰۵","price":17185900},{"date":"۱۴۰۵/۰۲/۰۶","price":17221700},{"date":"۱۴۰۵/۰۲/۰۷","price":17467600},{"date":"۱۴۰۵/۰۲/۰۸","price":18237000},{"date":"۱۴۰۵/۰۲/۰۹","price":19657000},{"date":"۱۴۰۵/۰۲/۱۰","price":19761800},{"date":"۱۴۰۵/۰۲/۱۲","price":20315100},{"date":"۱۴۰۵/۰۲/۱۳","price":20337000},{"date":"۱۴۰۵/۰۲/۱۴","price":20800100},{"date":"۱۴۰۵/۰۲/۱۵","price":19159900},{"date":"۱۴۰۵/۰۲/۱۶","price":19323100},{"date":"۱۴۰۵/۰۲/۱۷","price":19483100},{"date":"۱۴۰۵/۰۲/۱۸","price":19483100},{"date":"۱۴۰۵/۰۲/۱۹","price":19323100},{"date":"۱۴۰۵/۰۲/۲۰","price":19168900},{"date":"۱۴۰۵/۰۲/۲۱","price":19807900},{"date":"۱۴۰۵/۰۲/۲۲","price":19587900},{"date":"۱۴۰۵/۰۲/۲۳","price":19586500},{"date":"۱۴۰۵/۰۲/۲۴","price":19595800},{"date":"۱۴۰۵/۰۲/۲۵","price":19595800},{"date":"۱۴۰۵/۰۲/۲۶","price":19406900},{"date":"۱۴۰۵/۰۲/۲۷","price":19275400},{"date":"۱۴۰۵/۰۲/۲۸","price":18986300},{"date":"۱۴۰۵/۰۲/۲۹","price":18986300},{"date":"۱۴۰۵/۰۲/۳۰","price":19219300},{"date":"۱۴۰۵/۰۲/۳۱","price":19150200},{"date":"۱۴۰۵/۰۳/۰۱","price":19150200},{"date":"۱۴۰۵/۰۳/۰۲","price":18558800},{"date":"۱۴۰۵/۰۳/۰۳","price":17948900},{"date":"۱۴۰۵/۰۳/۰۴","price":18259100},{"date":"۱۴۰۵/۰۳/۰۵","price":18214800},{"date":"۱۴۰۵/۰۳/۰۶","price":18214800},{"date":"۱۴۰۵/۰۳/۰۷","price":18132400},{"date":"۱۴۰۵/۰۳/۰۸","price":18132400},{"date":"۱۴۰۵/۰۳/۰۹","price":17981900},{"date":"۱۴۰۵/۰۳/۱۰","price":18120600},{"date":"۱۴۰۵/۰۳/۱۱","price":18584400},{"date":"۱۴۰۵/۰۳/۱۲","price":18225200},{"date":"۱۴۰۵/۰۳/۱۳","price":18276900},{"date":"۱۴۰۵/۰۳/۱۴","price":18276900},{"date":"۱۴۰۵/۰۳/۱۵","price":18276900},{"date":"۱۴۰۵/۰۳/۱۶","price":17983000},{"date":"۱۴۰۵/۰۳/۱۷","price":18305500},{"date":"۱۴۰۵/۰۳/۱۸","price":18063200},{"date":"۱۴۰۵/۰۳/۱۹","price":17925100},{"date":"۱۴۰۵/۰۳/۲۰","price":17914300},{"date":"۱۴۰۵/۰۳/۲۱","price":17866900},{"date":"۱۴۰۵/۰۳/۲۲","price":17866900},{"date":"۱۴۰۵/۰۳/۲۳","price":17220800},{"date":"۱۴۰۵/۰۳/۲۴","price":17371932},{"date":"۱۴۰۵/۰۳/۲۵","price":16296900},{"date":"۱۴۰۵/۰۳/۲۶","price":15651900},{"date":"۱۴۰۵/۰۳/۲۷","price":16181900},{"date":"۱۴۰۵/۰۳/۲۸","price":15664200},{"date":"۱۴۰۵/۰۳/۲۹","price":15664200},{"date":"۱۴۰۵/۰۳/۳۰","price":16101400},{"date":"۱۴۰۵/۰۳/۳۱","price":16160200},{"date":"۱۴۰۵/۰۴/۰۱","price":15935200},{"date":"۱۴۰۵/۰۴/۰۲","price":16085200},{"date":"۱۴۰۵/۰۴/۰۳","price":16085200},{"date":"۱۴۰۵/۰۴/۰۴","price":16085200},{"date":"۱۴۰۵/۰۴/۰۵","price":16085200},{"date":"۱۴۰۵/۰۴/۰۶","price":16401500},{"date":"۱۴۰۵/۰۴/۰۷","price":17290000},{"date":"۱۴۰۵/۰۴/۰۸","price":16783100},{"date":"۱۴۰۵/۰۴/۰۹","price":16910700},{"date":"۱۴۰۵/۰۴/۱۰","price":17257000},{"date":"۱۴۰۵/۰۴/۱۱","price":17462700},{"date":"۱۴۰۵/۰۴/۱۲","price":17462700},{"date":"۱۴۰۵/۰۴/۱۳","price":17462700},{"date":"۱۴۰۵/۰۴/۱۴","price":17728400},{"date":"۱۴۰۵/۰۴/۱۵","price":17737400},{"date":"۱۴۰۵/۰۴/۱۶","price":17740700},{"date":"۱۴۰۵/۰۴/۱۷","price":17883300},{"date":"۱۴۰۵/۰۴/۱۸","price":17936900},{"date":"۱۴۰۵/۰۴/۱۹","price":17936900},{"date":"۱۴۰۵/۰۴/۲۰","price":17476100},{"date":"۱۴۰۵/۰۴/۲۱","price":17660300},{"date":"۱۴۰۵/۰۴/۲۲","price":17682200},{"date":"۱۴۰۵/۰۴/۲۳","price":17891900},{"date":"۱۴۰۵/۰۴/۲۴","price":18360300},{"date":"۱۴۰۵/۰۴/۲۵","price":18296100},{"date":"۱۴۰۵/۰۴/۲۸","price":18767500},{"date":"۱۴۰۵/۰۴/۲۹","price":18184300},{"date":"۱۴۰۵/۰۴/۳۰","price":18558300},{"date":"۱۴۰۵/۰۴/۳۱","price":19003400},{"date":"۱۴۰۵/۰۵/۰۱","price":18855400},{"date":"۱۴۰۵/۰۵/۰۲","price":18855400},{"date":"۱۴۰۵/۰۵/۰۳","price":18255000},{"date":"۱۴۰۵/۰۵/۰۴","price":17878900},{"date":"۱۴۰۵/۰۵/۰۵","price":18209300},{"date":"۱۴۰۵/۰۵/۰۶","price":18341300},{"date":"۱۴۰۵/۰۵/۰۷","price":18810200},{"date":"۱۴۰۵/۰۵/۰۸","price":18665400},{"date":"۱۴۰۵/۰۵/۰۹","price":18665400},{"date":"۱۴۰۵/۰۵/۱۰","price":18698000},{"date":"۱۴۰۵/۰۵/۱۱","price":18330500},{"date":"۱۴۰۵/۰۵/۱۲","price":18382400},{"date":"۱۴۰۵/۰۵/۱۳","price":18382400},{"date":"۱۴۰۵/۰۵/۱۴","price":18561600},{"date":"۱۴۰۵/۰۵/۱۵","price":18618600},{"date":"۱۴۰۵/۰۵/۲۰","price":19205600},{"date":"۱۴۰۵/۰۵/۲۱","price":19205600},{"date":"۱۴۰۵/۰۵/۲۲","price":19205600},{"date":"۱۴۰۵/۰۵/۲۳","price":19205600},{"date":"۱۴۰۵/۰۵/۲۴","price":19079400},{"date":"۱۴۰۵/۰۵/۲۵","price":19039400},{"date":"۱۴۰۵/۰۵/۲۶","price":19229200},{"date":"۱۴۰۵/۰۵/۲۷","price":19304000},{"date":"۱۴۰۵/۰۵/۲۸","price":19759400},{"date":"۱۴۰۵/۰۵/۲۹","price":19852700},{"date":"۱۴۰۵/۰۵/۳۰","price":19852700},{"date":"۱۴۰۵/۰۵/۳۱","price":21036000},{"date":"۱۴۰۵/۰۶/۰۱","price":21746400},{"date":"۱۴۰۵/۰۶/۰۲","price":22022200},{"date":"۱۴۰۵/۰۶/۰۳","price":21653100},{"date":"۱۴۰۵/۰۶/۰۴","price":21677400},{"date":"۱۴۰۵/۰۶/۰۵","price":21746400},{"date":"۱۴۰۵/۰۶/۰۶","price":21746400},{"date":"۱۴۰۵/۰۶/۰۷","price":21839600},{"date":"۱۴۰۵/۰۶/۰۸","price":21839600},{"date":"۱۴۰۵/۰۶/۰۹","price":22218200},{"date":"۱۴۰۵/۰۶/۱۰","price":22195800},{"date":"۱۴۰۵/۰۶/۱۱","price":22835100},{"date":"۱۴۰۵/۰۶/۱۲","price":23518800},{"date":"۱۴۰۵/۰۶/۱۳","price":23518800},{"date":"۱۴۰۵/۰۶/۱۴","price":23674400},{"date":"۱۴۰۵/۰۶/۱۵","price":23353600},{"date":"۱۴۰۵/۰۶/۱۶","price":23062200},{"date":"۱۴۰۵/۰۶/۱۷","price":23623400},{"date":"۱۴۰۵/۰۶/۱۸","price":24342500},{"date":"۱۴۰۵/۰۶/۱۹","price":24181400},{"date":"۱۴۰۵/۰۶/۲۰","price":24181400},{"date":"۱۴۰۵/۰۶/۲۱","price":23916800},{"date":"۱۴۰۵/۰۶/۲۲","price":23476800},{"date":"۱۴۰۵/۰۶/۲۳","price":23283400},{"date":"۱۴۰۵/۰۶/۲۴","price":23259100},{"date":"۱۴۰۵/۰۶/۲۵","price":23501300},{"date":"۱۴۰۵/۰۶/۲۶","price":23363000},{"date":"۱۴۰۵/۰۶/۲۷","price":23363000},{"date":"۱۴۰۵/۰۶/۲۸","price":23878100},{"date":"۱۴۰۵/۰۶/۲۹","price":24123700},{"date":"۱۴۰۵/۰۶/۳۰","price":23707200},{"date":"۱۴۰۵/۰۶/۳۱","price":23939000},{"date":"۱۴۰۵/۰۷/۰۱","price":23765900},{"date":"۱۴۰۵/۰۷/۰۲","price":24124600},{"date":"۱۴۰۵/۰۷/۰۳","price":24124600},{"date":"۱۴۰۵/۰۷/۰۴","price":23829800},{"date":"۱۴۰۵/۰۷/۰۵","price":23901600},{"date":"۱۴۰۵/۰۷/۰۶","price":24401200},{"date":"۱۴۰۵/۰۷/۰۷","price":25265500}] [{"id":"symbol-0","name":"گرم طلای ۱۸ عیار","price":"۲۵٬۲۶۵٬۵۰۰","rawPrice":25265500,"last2Diff":"۳٫۵۴%","last7Diff":"۶٫۳۱%","rawLast2Diff":3.5420389161188797,"rawLast7Diff":6.309880963902062,"lastUpdate":"۲۲:۳۵","sparklineData":[237659000,241246000,241246000,238298000,239016000,244012000,252655000],"sparklineColor":"#49b176"},{"id":"symbol-1","name":"مثقال طلا ۱۸ عیار","price":"۱۰۹٬۴۴۸٬۰۰۰","rawPrice":109448000,"last2Diff":"۳٫۵۴%","last7Diff":"۶٫۳۱%","rawLast2Diff":3.5439253751111615,"rawLast7Diff":6.308703971715249,"lastUpdate":"۲۲:۳۵","sparklineData":[1029530000,1044990000,1044990000,1032320000,1035430000,1057020000,1094480000],"sparklineColor":"#49b176"},{"id":"symbol-2","name":"اونس طلای جهانی","price":"۴۱۷٫۱۲۱","rawPrice":417.121,"last2Diff":"۱٫۱۸%","last7Diff":"−۲٫۶۳%","rawLast2Diff":1.1751836148599437,"rawLast7Diff":-2.630319639393175,"lastUpdate":"۲۲:۳۵","sparklineData":[4283.89,4266.09,4288.62,4285,4285,4122.76,4171.21],"sparklineColor":"#d6455d"},{"id":"symbol-3","name":"سکه امامی","price":"۲۵۵٬۰۱۰٬۰۰۰","rawPrice":255010000,"last2Diff":"۳٫۲۵%","last7Diff":"۷٫۸۴%","rawLast2Diff":3.249185173188655,"rawLast7Diff":7.835757780784844,"lastUpdate":"۲۲:۳۵","sparklineData":[2364800000,2400100000,2400100000,2384900000,2405050000,2469850000,2550100000],"sparklineColor":"#49b176"},{"id":"symbol-4","name":"سکه بهار آزادی","price":"۲۴۶٬۵۰۰٬۰۰۰","rawPrice":246500000,"last2Diff":"۲٫۳۷%","last7Diff":"۶٫۱۵%","rawLast2Diff":2.367109634551495,"rawLast7Diff":6.1470556572289805,"lastUpdate":"۲۲:۳۵","sparklineData":[2322250000,2360750000,2360750000,2343750000,2352400000,2408000000,2465000000],"sparklineColor":"#49b176"},{"id":"symbol-5","name":"نیم سکه","price":"۱۳۲٬۰۰۰٬۰۰۰","rawPrice":132000000,"last2Diff":"۳٫۹۴%","last7Diff":"۸٫۶۴%","rawLast2Diff":3.937007874015748,"rawLast7Diff":8.641975308641975,"lastUpdate":"۲۲:۳۵","sparklineData":[1215000000,1230000000,1230000000,1220000000,1225000000,1270000000,1320000000],"sparklineColor":"#49b176"},{"id":"symbol-6","name":"ربع سکه","price":"۷۱٬۰۰۰٬۰۰۰","rawPrice":71000000,"last2Diff":"۴٫۴۱%","last7Diff":"۱۰٫۹۴%","rawLast2Diff":4.411764705882353,"rawLast7Diff":10.9375,"lastUpdate":"۲۲:۳۵","sparklineData":[640000000,650000000,650000000,645000000,650000000,680000000,710000000],"sparklineColor":"#49b176"},{"id":"symbol-7","name":"سکه گرمی","price":"۳۷٬۰۰۰٬۰۰۰","rawPrice":37000000,"last2Diff":"۲٫۷۸%","last7Diff":"۸٫۸۲%","rawLast2Diff":2.7777777777777777,"rawLast7Diff":8.823529411764707,"lastUpdate":"۲۲:۳۰","sparklineData":[340000000,340000000,340000000,340000000,340000000,360000000,370000000],"sparklineColor":"#49b176"}] (function() { 'use strict'; var chartStrokeColor = document.querySelector('.ecodata-widget')?.getAttribute('data-chart-stroke') || '#00d1d1'; // Theme detection function detectTheme() { let html = document.documentElement; while (html) { if (html.classList && html.classList.contains('dark')) { return 'dark'; } html = html.parentElement; } return 'light'; } function updateTheme(theme) { const isDark = theme === 'dark'; const colors = isDark ? { background: '#1f2937', stroke: chartStrokeColor, h1: '#f3f4f6', labels: '#9ca3af', border: '#4b5563' } : { background: '#ffffff', stroke: chartStrokeColor, h1: '#111827', labels: '#374151', border: '#c4c4c4' }; // Update CSS variables on the widget container const widget = document.querySelector('.ecodata-widget'); if (widget) { widget.style.setProperty('--ecodata-background', colors.background); widget.style.setProperty('--ecodata-h1', colors.h1); widget.style.setProperty('--ecodata-labels', colors.labels); widget.style.setProperty('--ecodata-border', colors.border); widget.style.setProperty('--ecodata-stroke', colors.stroke); } // Update chart colors if chart exists if (window.root && window.chartSeries && window.xAxis) { window.chartSeries.set('stroke', am5.color(colors.stroke)); window.chartSeries.set('fill', am5.color(colors.stroke)); // Update axis labels const xRenderer = window.xAxis.get('renderer'); const yRenderer = window.xAxis.chart.yAxes.getIndex(0).get('renderer'); if (xRenderer) { xRenderer.labels.template.setAll({ fill: am5.color(colors.labels) }); } if (yRenderer) { yRenderer.labels.template.setAll({ fill: am5.color(colors.labels) }); } // Update grid if (window.xAxis.chart && window.xAxis.chart.yAxes.length > 0) { const yAxis = window.xAxis.chart.yAxes.getIndex(0); yAxis.get('renderer').grid.template.setAll({ stroke: am5.color(colors.labels), strokeOpacity: 0.3 }); } // Update tooltips const seriesTooltip = window.chartSeries.get('tooltip'); if (seriesTooltip) { seriesTooltip.get('background').setAll({ fill: am5.color(colors.background), stroke: am5.color(0xffffff), shadowOpacity: theme === 'dark' ? 0.3 : 0.1 }); seriesTooltip.label.setAll({ fill: am5.color(theme === 'dark' ? 0xffffff : parseInt(colors.h1.replace('#', ''), 16)), textAlign: 'center' }); // Force update the label fill color if (seriesTooltip.label) { seriesTooltip.label.set('fill', am5.color(theme === 'dark' ? 0xffffff : parseInt(colors.h1.replace('#', ''), 16))); } } // Update X-axis tooltip if (window.xAxis) { const xTooltip = window.xAxis.get('tooltip'); if (xTooltip) { xTooltip.get('background').setAll({ fill: am5.color(colors.background), stroke: am5.color(0xffffff) }); xTooltip.label.setAll({ fill: am5.color(theme === 'dark' ? 0xffffff : parseInt(colors.h1.replace('#', ''), 16)), textAlign: 'center' }); } } // Scrollbar removed - no longer updating scrollbar tooltip } // Table and buttons will automatically update via CSS variables } // Initialize theme let currentTheme = detectTheme(); updateTheme(currentTheme); // Watch for theme changes const observer = new MutationObserver(() => { const newTheme = detectTheme(); if (newTheme !== currentTheme) { currentTheme = newTheme; updateTheme(newTheme); } }); observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class'], subtree: true }); // Get data const chartDataEl = document.querySelector('.chart-data'); const tableDataEl = document.querySelector('.table-data'); if (!chartDataEl || !window.am5) { console.error('Chart data or amCharts not found'); return; } const chartData = JSON.parse(chartDataEl.textContent || '[]'); const tableData = tableDataEl ? JSON.parse(tableDataEl.textContent || '[]') : []; if (chartData.length === 0) { document.getElementById('chartdiv').innerHTML = ' No data available '; return; } // Create chart (matching user's example code) window.root = am5.Root.new('chartdiv'); window.root.setThemes([am5themes_Animated.new(window.root)]); const chart = window.root.container.children.push( am5xy.XYChart.new(window.root, { panX: true, panY: false, wheelX: 'panX', wheelY: 'zoomX', paddingBottom: 30, paddingRight: 20, paddingLeft: 60, paddingTop: 5 }) ); const cursor = chart.set('cursor', am5xy.XYCursor.new(window.root, { behavior: 'none' })); cursor.lineY.set('visible', false); // Create Y-axis const yRenderer = am5xy.AxisRendererY.new(window.root, {}); const yAxis = chart.yAxes.push( am5xy.ValueAxis.new(window.root, { renderer: yRenderer }) ); // Calculate Y-axis domain with 5% padding const values = chartData.map(d => d.price); const minValue = Math.min(...values); const maxValue = Math.max(...values); const range = maxValue - minValue; const padding = range * 0.05; const minDomain = Math.max(0, minValue - padding); const maxDomain = maxValue + padding; yAxis.set('min', minDomain); yAxis.set('max', maxDomain); // Format Y-axis labels (compact Persian format) yRenderer.labels.template.adapters.add('text', function(text) { const num = parseFloat(text); if (isNaN(num)) return text; return new Intl.NumberFormat('fa-IR', { notation: 'compact' }).format(num); }); // Create X-axis const xRenderer = am5xy.AxisRendererX.new(window.root, {}); xRenderer.grid.template.set('visible', false); window.xAxis = chart.xAxes.push( am5xy.CategoryAxis.new(window.root, { renderer: xRenderer, categoryField: 'date' }) ); window.xAxis.data.setAll(chartData); // Set axis label colors based on theme const themeColors = currentTheme === 'dark' ? { labels: '#9ca3af', h1: '#f3f4f6', background: '#1f2937' } : { labels: '#374151', h1: '#111827', background: '#ffffff' }; xRenderer.labels.template.setAll({ fill: am5.color(themeColors.labels), fontSize: '12px', marginTop: 30, paddingTop: 20, fontFamily: 'IRANYekan', draggable: true }); yRenderer.labels.template.setAll({ fill: am5.color(themeColors.labels), fontSize: '12px', paddingRight: 20, fontFamily: 'IRANYekan', draggable: true }); // X-axis tooltip const xTooltip = am5.Tooltip.new(window.root, { getFillFromSprite: false, labelText: '[fontFamily: IRANYekan; fontSize: 12px; textAlign: center;]تاریخ: {category}' }); xTooltip.get('background').setAll({ fill: am5.color(themeColors.background), fillOpacity: 1, stroke: am5.color(0xffffff), strokeWidth: 1, cornerRadiusTL: 8, cornerRadiusTR: 8, cornerRadiusBL: 8, cornerRadiusBR: 8 }); xTooltip.label.setAll({ fill: am5.color(currentTheme === 'dark' ? 0xffffff : parseInt(themeColors.h1.replace('#', ''), 16)), textAlign: 'center' }); window.xAxis.set('tooltip', xTooltip); // Grid styling - horizontal lines only, dashed yAxis.get('renderer').grid.template.setAll({ stroke: am5.color(themeColors.labels), strokeOpacity: 0.3, strokeDasharray: [3, 3] }); // Create series window.chartSeries = chart.series.push( am5xy.LineSeries.new(window.root, { name: 'Series', xAxis: window.xAxis, yAxis: yAxis, valueYField: 'price', categoryXField: 'date' }) ); window.chartSeries.strokes.template.set('strokeWidth', 2); window.chartSeries.fills.template.setAll({ visible: true, fillOpacity: 0.4 }); var strokeHex = parseInt(chartStrokeColor.replace('#', ''), 16); window.chartSeries.set('stroke', am5.color(strokeHex)); window.chartSeries.set('fill', am5.color(strokeHex)); // Series tooltip (matching Recharts styling) const seriesTooltip = am5.Tooltip.new(window.root, { getFillFromSprite: false, labelText: '[fontFamily: IRANYekan; fontSize: 14px; textAlign: center;]{valueY}' }); seriesTooltip.get('background').setAll({ fill: am5.color(themeColors.background), fillOpacity: 1, stroke: am5.color(0xffffff), strokeWidth: 1, cornerRadiusTL: 8, cornerRadiusTR: 8, cornerRadiusBL: 8, cornerRadiusBR: 8, shadowBlur: 10, shadowColor: am5.color(0x000000), shadowOpacity: currentTheme === 'dark' ? 0.3 : 0.1 }); seriesTooltip.label.setAll({ fill: am5.color(currentTheme === 'dark' ? 0xffffff : parseInt(themeColors.h1.replace('#', ''), 16)), textAlign: 'center' }); // Use adapter to ensure fill color is applied dynamically seriesTooltip.label.adapters.add('fill', function(fill, target) { // Check current theme dynamically let html = document.documentElement; let isDark = false; while (html) { if (html.classList && html.classList.contains('dark')) { isDark = true; break; } html = html.parentElement; } const themeColors = isDark ? { h1: '#f3f4f6' } : { h1: '#111827' }; return am5.color(isDark ? 0xffffff : parseInt(themeColors.h1.replace('#', ''), 16)); }); window.chartSeries.set('tooltip', seriesTooltip); window.chartSeries.data.setAll(chartData); // Scrollbar removed - user requested to remove scale bar above chart // Store data for filter buttons window.chartData = chartData; // Initial zoom to show all data window.xAxis.zoomToIndexes(0, window.chartData.length); // Filter buttons (matching user's example) const filterButtons = document.querySelectorAll('.filter-btn'); let activeFilter = 'all'; filterButtons.forEach(btn => { btn.addEventListener('click', function() { const filter = this.getAttribute('data-filter'); activeFilter = filter; // Update button styles using CSS classes filterButtons.forEach(b => { const isActive = b === this; b.classList.toggle('active', isActive); }); // Zoom chart (matching user's example code) if (filter === 'all') { window.xAxis.zoomToIndexes(0, window.chartData.length); } else if (filter === '7') { window.xAxis.zoomToIndexes(window.chartData.length - 7, window.chartData.length); } else if (filter === '30') { window.xAxis.zoomToIndexes(window.chartData.length - 30, window.chartData.length); } else if (filter === '365') { window.xAxis.zoomToIndexes(window.chartData.length - 365, window.chartData.length); } }); }); // Table sorting const sortButtons = document.querySelectorAll('.sort-btn'); sortButtons.forEach(btn => { btn.addEventListener('click', function() { const column = this.getAttribute('data-column'); // Simple sorting - could be enhanced console.log('Sort by', column); }); }); series.appear(500); chart.appear(500, 100); })();