title: Chart.js x-axis with date DD-MM-YYYY - React
body: <p>I am trying to display a graph using the library <code>Chart.js</code>.</p>
  
  <p>My data are in the format:</p>
  
  <pre><code>data: [["15-11-2019", 25], ["16-11-2019", 35], ["17-11-2019", 40], ["18-11-2019", 20], ["19-11-2019", 15]]
  </code></pre>
  
  <p>I am not able to transform the x-Axis in a time-axis.</p>
  
  <p>I tried to pass in the <code>options</code> parameter the <code>time</code> type but it does not seem to work.
  The graph renders, but the x-axis does not exists, only the y-axis exists.</p>
  
  <pre><code>import React, {Component,  useState, useEffect, useCallback} from 'react';
  import Plot from 'react-plotly.js';
  import { Chart } from 'react-charts'
  
  function MyChart() {
      const data = React.useMemo(
          () =&gt; [
              {
                  label: 'Series 1',
                  data: [["15-11-2019", 25], ["16-11-2019", 35], ["17-11-2019",40], ["18-11-2019", 20], ["19-11-2019", 15]]
              }],
          []
      )
  
      const axes = React.useMemo(
          () =&gt; [
              { primary: true, type: 'linear', position: 'bottom' },
              { type: 'linear', position: 'left' },
          ],
          []
      )
  
      const options = React.useMemo(
          () =&gt; [
              {
          scales: {
              xAxes: [{
                  type: 'time',
                  time: {
                      unit: 'day'
                  }
              }]
          }
      }
          ],
          []
      )
  
      return (
          // A react-chart hyper-responsively and continuusly fills the available
          // space of its parent element automatically
          &lt;div
              style={{
                  width: '600px',
                  height: '500px'
              }}
          &gt;
              &lt;Chart data={data} axes={axes} options={options}/&gt;
          &lt;/div&gt;
      )
  }
  
  export default MyChart;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/pPfsf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pPfsf.png" alt="MyGraph"></a></p>