Is it possible to show both, the relative and absolute difference in the delta tag of a Plotly indicator?
My current workaround is like this:
type: "indicator",
mode: "number+delta",
value: 450,
title: {
text: "Reference: 500 (-10%)"
},
delta: { reference: 500, position: "right" }
However, it would be nice, to have both information in the colored delta tag.
Edit:
I went into plotly-finance.js and replaced the line (inside the drawDelta()-function)
return (value > 0 ? trace.delta.increasing.symbol : trace.delta.decreasing.symbol) + numberFmt(value);
with
return (value > 0 ? trace.delta.increasing.symbol : trace.delta.decreasing.symbol) + deltaFmtRel(cd[0].relativeDelta) + " (" + deltaFmtAbs(cd[0].delta)+ ")";
and added functions
var deltaFmtAbs = function(v) {
var tmpAx = deltaAx;
tmpAx.tickformat = '';
return Axes.tickText(tmpAx, v).text;
};
var deltaFmtRel = function(v) {
var tmpAx = deltaAx;
tmpAx.tickformat = '2%';
return Axes.tickText(tmpAx, v).text;
};
Of course, you can't have any indicators without the delta-tags, if you do it that way.

