Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint-disable no-new */
charts[elementName] = new RadialProgressChart(elementName, { diameter: 100,
min: 0,
max: 100,
series: data,
center: handleCenterText(textValue, textIndexToUse),
});
} else {
e.update(data);
}
const opt = {};
opt.value = tooltip;
opt.modifiers = ['top-right'];
const ele = d3.select(elementName).node();
VTooltip.bind(ele, opt);
/* The next block of code digs into the SVG and sets the opacity of either
the daily arc and/or the weekly arc to 0 (hides) if the model specifies either
a monthly or weekly target. IF weekly target is set, only the arc for weekly and
monthly is displayed. If a monthly target is set, only the arc for the monthly
is visible.
*/
if (!useDaily) {
const svg = d3.select(elementName).select('svg');
const pg = svg.select('g');
pg.selectAll('g').each(function u(p, i) {
const uw = useWeekly;
if (i === 0) {
d3.select(this).style('opacity', 0.0);
}
if (i === 1 && !uw) {