java - Time format on y axis Primafaces multiaxis LineChart -


i want display time on y axis of chart hh:mm:ss time format. represent data in seconds.

is possible?

i used extender solve problem:

xhtml:

<p:chart type="line" model="#{mybean.multiaxischartmodel}" style="width:800px;" extender="customformatter" /> <script type="text/javascript">     function customformatter() {         this.cfg.axes.y2axis.tickoptions.formatter = function(format, value) {             d = number(value);             var h = math.floor(d / 3600);             var m = math.floor(d % 3600 / 60);             var s = math.floor(d % 3600 % 60);             return (h.tostring().length == 1 ? ("0" + h) : h) + ":" + (m.tostring().length == 1 ? ("0" + m) : m) + ":" + (s.tostring().length == 1 ? ("0" + s) : s);         };     } </script> 

bean:

multiaxischartmodel.setextender("customformatter"); 

enter image description here


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -