0

i am very new to coding and stucked somewhere while making LineTooltip using react-d3 library. i am getting time unix time format like:1450274696000 in json and need to parse it and show d,m in x-axis i am using this function:

   var parseDate = d3.time.format("%B %d, %Y");
   var x = function(d) {
      return parseDate(new Date(d.index))
     } 

and calling linetooltip as

 <LineTooltip width= {1200} height= {400} interpolate = {"cardinal"} data= {chartData} chartSeries= {chartSeries} x= {x} xScale={xScale} />

Please help me out!... Thanks in advance

moni sogani
  • 278
  • 2
  • 13

1 Answers1

0

no neeed to pasrse data as milliseconds can be directly converted to Date object, like this

 var x = function(d) {
 return new Date(d.index)
  } 
piyush singh
  • 395
  • 8
  • 24