Reputation: 344
The following is the formatter I am using.
Tooltip tooltip = new Tooltip();
tooltip.setxDateFormat("MMM dd, YYYY");
tooltip.setFormatter("function() { var d = new Date(this.x);" + "return " + "'<b>'+this.series.name +'</b><br/>"
+ "<strong>Value :</strong> '+ this.y +'<br/>" + "<strong>Start Date :</strong> '+ this.x; " + "}");
chartConfig.setTooltip(tooltip);
How to:
1) Round of value with two decimal places
2) Using Date Format like Nov 30, 2016
Kindly assist.
Upvotes: 1
Views: 903
Reputation: 4967
Vaadin Charts uses Highcharts on the client side, which means that you can use Highcharts JS APIs for formatting, the following calls should work:
Highcharts.numberFormat(this.y, 2)
Highcharts.dateFormat('%b %d %Y', new Date(this.x))
Upvotes: 1