all these rules are still required:
contentFormatter: function (e) {
var content = ” “;
for (var i = 0; i < e.entries.length; i++) {
if( e.entries[i].dataPoint.y <= 1.24 )
return “” + CanvasJS.formatNumber(e.entries[i].dataPoint.y, “#,##0.0”) + ““;
else
if( e.entries[i].dataPoint.y <= 1.25 )
return “<2.5“;
else
return “” + CanvasJS.formatNumber(e.entries[i].dataPoint.y, “#,##0.0”) + ““;
}
Hi, this works, but now we have lost the ‘zero’ after the decimal place for whole numbers. Is it possible to have both? A zero after the decimal place for whole numbers, and also a comma for the decimal place?
I neglected to include the link to the JSFiddle: https://jsfiddle.net/canvasjs/h41e85dv/8/
Hi again, I’m trying to add “cultureinfo” so that the decimal is displayed as a comma instead of a point. However, following these instructions: https://canvasjs.com/docs/charts/chart-options/culture/ , it doesn’t work for some reason?
thanks very much!
Hi, if you change some of the values to ‘null’ in this jsfiddel: https://jsfiddle.net/h41e85dv/ for “country 6′ the line doesn’t connect between the remaining values. How can you make sure, even if there are only two datapoints for one of the lines, that the line still displays? I’ve tried adding “connectNullData: true” but it doesn’t work.
Correction, it does work, thanks!
No, that doesn’t work unfortunately. Any other way?
Hi again, in this solution: https://jsfiddle.net/h41e85dv/, if a value is less than 1, e.g. 0.9, the “0” before the dot does not display. Is there a way to fix this? i.e. The tooltip shows “.9” but it should show “0.9”
THANK YOU!
no, it doesn’t work for me. Please see this updated JSFiddle. Did you do anything else apart from add the lines: yValueFormatString:”##.0″,
Great, thanks!
Is it possible to display integers with no decimal point as X.0 in this jsfiddle? https://jsfiddle.net/canvasjs/w90ze7us/40/
I can’t get this to work, I’m not sure why. I’m going to try to find the previous jsfiddle you were helping with.
Ah, sorry, now I understand, the index is the ONLY thing that needs to be changed in this method. That is better, thanks!