javascript - Dynamically update tooltip date format highchart -
I want to update tooltip date format dynamically. Like button, tooltip date format will be replaced by another button. Check out my HTML:
& lt; Div id = "container" style = "height: 300px" & gt; & Lt; / Div & gt; & Lt; Button id = "dateFormate" & gt; ChangeDateFormat & lt; / Button & gt; Click on button in date format% m-% d-% y javascript
$ (function () {$ ('# container') HighTart ({xXx: {type: 'datetime'}, tooltip: {xDateFormat: '% Y-% m-% d', shared: true}, plot options: {series: {pointStart: Date.UTC ( 2012, 0, 1), point interval: 24 * 3600 * 1000}}, series: [[Data: [29.9, 71.5, 106.4, 12 9.2, 144.0, 176.0, 135.6, 148.5, 216.4, 95.6, 54.4]}, {Data: [29.9, 71.5, 106.4, 12 9.2, 144.0, 176.0, 135.6, 148.5, 216.4, 19.1, 95.6, 54.4] .reverse ()}]}); });
You can also define the tooltip format in the series, then one Update serie with new format.
Example:
chart. Series [0] .update ({tooltip: {xDateFormat: '% y /% m /% d',}});
Comments
Post a Comment