Home Forums Chart Support viewPort Max/Min with date value Reply To: viewPort Max/Min with date value

#32572

Hey @Manoj Mohan

Can you share a jsfiddle example that viewportMinimum works with time?

I tried 2 different ways, one is have x value as timestamp, and set xValueType: “dateTime”. like following


  {
  "type": "line",
  "axisX": [
    {
      "viewportMaximum": 1611186373807,
      "viewportMinimum": 1611182782013
    }
  ],

  "data": [
    {
      "markerType": "circle",
     
      "type": "line",
      "xValueType": "dateTime",
      
     
      "dataPoints": [
        {
          "y": 101789,
          "x": 1611185700000,
        },
        {
          "y": 12834,
          "x": 1611186300000,
        }
      ],

    }
  ],

}

But it doesn’t set the range to my desired value. However if I comment out xValueType: "dateTime", it will work because x value got treated as number.

I tried to set x and viewportMinimum to Date object like viewportMinimum: new Date(2019,03,14), but it still doesn’t work.