javascript - Highcharts - tooltip headerformat for 2 decimal places not working -
i trying configure tooltip of displays 2 decimal places, headerformat not seem wokring , keeps showing entire decimal places.
what going wrong here?
{ "chart":{ "type":"line", "height":40, "width":40 }, "title":{ "text":null }, "subtitle":{ "text":null }, "xaxis":{ "categories":[ ] }, "yaxis":{ "title":{ "enabled":true, "text":"amount (dollars)", "style":{ "fontweight":"normal" } }, "plotlines":[ { "value":0, "width":1, "color":"#808080" } ] }, "options":{ "legend":{ "enabled":false } }, "plotoptions":{ }, "series":[ { "name":"total", "data":[ { "name":"apr'2016", "y":1372406438.2385998 }, { "name":"may'2016", "y":5301389724.7499 }, { "name":"jun'2016", "y":549467904.6918 }, { "name":"july'2016", "y":549040695.1202999 }, { "name":"aug'2016", "y":1160837116.1138 }, { "name":"sep'2016", "y":22.7612 } ], "color":"#008ce6", "marker":{ "enabled":false }, "id":"series-3" }, { "name":"toal timely", "data":[ { "name":"apr'2016", "y":427101358.1748, "month":"apr" }, { "name":"may'2016", "y":5191919648.9571, "month":"may" }, { "name":"jun'2016", "y":288691855.262, "month":"jun" }, { "name":"july'2016", "y":264281732.18769997, "month":"july" }, { "name":"aug'2016", "y":853641906.2942, "month":"aug" }, { "name":"sep'2016", "y":0, "month":"sep" } ], "color":"#4ca977", "marker":{ "enabled":false }, "id":"series-4" }, { "name":"total untimely", "data":[ { "name":"apr'2016", "y":945305080.0637999, "month":"apr" }, { "name":"may'2016", "y":109470075.79279998, "month":"may" }, { "name":"jun'2016", "y":260776049.4298, "month":"jun" }, { "name":"july'2016", "y":284758962.93259996, "month":"july" }, { "name":"aug'2016", "y":307195209.8196, "month":"aug" }, { "name":"sep'2016", "y":22.7612, "month":"sep" } ], "color":"#e54343", "marker":{ "enabled":false }, "id":"series-5" } ], "tooltip":{ "pointformat":"<b>{point.y}</b>", "shared":true } }
add decimals point.y value.
"pointformat": "<b>{point.y:.2f}</b><br>",
example:
Comments
Post a Comment