How can I add a new line to jquery flot ticks
Asked Answered
E

2

5

I am using JQuery Flot to create some graphs. So far I have managed to format my Ticks using tickformatter

The graph looks like this: http://i1358.photobucket.com/albums/q779/Angel_Ruiz_Morales/Capture.gif

The only problem I am having now is that I would like the Ticks to appear as follows: Today\n{TIME}

I have tried adding \n character and see it appended but for some reason flot still displays Today {TIME} inline rather than on separate lines.

Does any one know a way to introduce a new line ?

Thanks!

Electroshock answered 12/12, 2012 at 20:54 Comment(0)
T
8

You need to use a <br> instead of \n. The tick labels are HTML.

Turfman answered 13/12, 2012 at 16:12 Comment(0)
C
0
 timeformat: "%m/%d/%y <br> %H:%M:%S"  

A working example: http://jsfiddle.net/72u66r0m/

Cleavage answered 2/12, 2014 at 0:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.