Is there any way to troubleshoot a chart when developing in iOS?
I've included the tooltip code below.
Any help would be very much appreciated
Code: Select all
function() {
const colorClassObject = {};
colorClassObject['Shortfall'] = 'shortfall-square';
colorClassObject['Savings'] = 'savings-square';
colorClassObject['University of Mississippi'] = 'school1-square';
colorClassObject['Mississippi State University'] = 'school2-square';
colorClassObject['Heald College-Honolulu'] = 'school3-square';
colorClassObject['Public In-state University'] = 'school4-square';
var seriesHtml = [];
var schoolColorIndex = 0;
var totalSpending = 0;
this.points.forEach(
(point) => {
if (point && point.point && point.series && point.y) {
const seriesName = point.series.name;
const seriesValueRaw = Math.floor(point.y);
const seriesValue = '$' + seriesValueRaw.toLocaleString();
totalSpending = point.point.totalSpending;
if (seriesValueRaw > 0)
seriesHtml.push(`
<li>
<span class="color-square ${colorClassObject[seriesName]}"> </span>
${seriesName}
<span class="series-value">${seriesValue}</span>
</li>`
);
}
}
);
totalSpending = '$' + Math.floor(totalSpending).toLocaleString();
return `<style>
ul {
padding: 0;
margin: 0;
list-style-type: none;
}
ul li {
margin-top: 16px;
}
ul li:first-child {
margin-top: 0;
}
.separator {
margin: 12px -5px 0 -5px;
border-top: 1px solid #c6c7ca
}
.series-value {
float: right;
display: inline-block;
}
.color-square {
width: 12px;
height: 12px;
display: inline-block;
margin-right: 9px;
}
.savings-square { background: "#3686a4"; }
.shortfall-square { background: "#eb838c"; }
.school1-square { background: "#353843"; }
.school2-square { background: "#fbc81a"; }
.school3-square { background: "#5bcd93"; }
.school4-square { background: "#4f3576"; }
</style>
<div style="z-index: 1; background: #fff; padding: 16px; width: 280px; border-radius: 3px; box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);"> <ul>
${seriesHtml.join('')}
</ul>
</div>
`;
}