Skip to content

Commit

Permalink
Improved regionalExposure.
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-musialowski committed Dec 3, 2024
1 parent 991dd39 commit 168d830
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions demos/xray_wip/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
@import url("https://code.highcharts.com/css/highcharts.css");
@import url("https://code.highcharts.com/dashboards/css/dashboards.css");

#container {
height: 1000px;
}

body {
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif;
}
Expand Down
1 change: 0 additions & 1 deletion demos/xray_wip/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ <h1>Highcharts Dashboards + Morningstar Portfolio Risk Score</h1>
<p id="loading-label" style="display: none;">Loading data…</p>
<div class="row" id="container">
<div class="cell" id="dashboard-col-0"></div>
<div class="cell" id="dashboard-col-1"></div>
</div>
<script src="./demo.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion demos/xray_wip/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function displaySecurityDetails (postmanJSON) {
},
components: [
{
renderTo: 'dashboard-col-1',
renderTo: 'dashboard-col-0',
connector: {
id: 'xray'
},
Expand Down
9 changes: 6 additions & 3 deletions src/XRay/XRayConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,14 @@ export class XRayConverter extends MorningstarConverter {

if (json.regionalExposure) {
for (const exposure of json.regionalExposure) {
const rowId = `${benchmarkId}_RegionalExposure_${exposure.salePosition}`;
const columnName = `${benchmarkId}_RegionalExposure_${exposure.salePosition}`;
table.setColumn(columnName);
const values = exposure.values;
const valueIndex = Object.keys(values);

for (let i = 1; i < 100; ++i) {
table.setCell(rowId, i - 1, values[i] || 0);
for (let i = 0; i < valueIndex.length; i++) {
table.setCell(`${benchmarkId}_Values`, i, valueIndex[i]);
table.setCell(columnName, i, values[parseInt(valueIndex[i])]);
}
}
}
Expand Down

0 comments on commit 168d830

Please sign in to comment.