I am making a chart using AmCharts. This is my stocklegend
section.
"stockLegend": {
"valueTextRegular": "[[time]]:[[value]]"
}
(Here, time is Date obj converted from timestamp that was present in json dataset loaded in javascript object used as data provider for chart. "dataProvider": consChartData.Data
where Data is an array holding value & time for a data point.)
Using [[time]]:[[value]]
, what I am getting is this:
The way I want it is like: Dec 23 2017, 5:21:00 IST: 17,686.54. Is there any way to format the [[time]] here in the way I want?
Edit
This question was not solved by How to format a JavaScript date because, if I use that here, it would be like "valueTextRegular":dateFormat("[[time]]") + "[[value]]",
. I have to make a new Date object from passed time and then it shows:
"NaN undefined NaN 17,686.54"
in output.