You must be logged in to post your query.
Home › Forums › Chart Support › Format “onmouseover” Text
Hi all!
I just can’t figure out how to format the values. I’d prefer time instead of date or both and I’d like to round the temperature values. 13,8 would be accurate enough ;)
Thx for help!
@epinephrine,
You can format the x and y-values being shown in toolTip by setting the xValueFormatString and yValueFormatString respectively, as per your requirement.
If you are still facing the issue, kindly create a JSFiddle reproducing the issue you are facing and share it with us so that we can look into the code, understand the scenario better and help you out.
— Shashi Ranjan Team CanvasJS
I’m not sure if it is the “best practice” but I was able to solve my problem via toolTip:{ contentFormatter: function ( e ) { var content = \” \”; for (var i = 0; i < e.entries.length; i++) { content += e.entries[i].dataSeries.name + \”<br/>Datum: \” +(new Date(e.entries[i].dataPoint.x)).toLocaleString(\”de-DE\”) + \”<br/>Wert: \” +(Math.round((e.entries[i].dataPoint.y)*100)/100); content += \”<br/>\”; } return content;
Additiional chars due to embedded into PHP
xValueFormatString and yValueFormatString properties can be used to format the respective x and y-values being shown in toolTip & indexLabel. However, to customize the complete content as per your requirement you can use toolTip contentFormatter function.
You must be logged in to reply to this topic. Login/Register