# Financial

chartjs-chart-financial (opens new window) との連携

const config = {
  type: 'candlestick',
  data: data,
  options: {
    scales: {
      x: {
        type: 'realtime',
        ticks: {
          source: 'auto'
        },
        realtime: {
          duration: 120000,
          refresh: 500,
          delay: 0,
          onRefresh: onRefresh
        }
      }
    },
    interaction: {
      intersect: false
    },
    animation: {
      duration: 0
    },
    plugins: {
      legend: {
        display: false,
      }
    }
  },
};

プレーンな JavaScript の場合、script タグを以下の順序で指定します。

<script src="path/to/chartjs/dist/chart.min.js"></script>
<script src="path/to/luxon/dist/luxon.min.js"></script>
<script src="path/to/chartjs-adapter-luxon/dist/chartjs-adapter-luxon.min.js"></script>
<script src="path/to/chartjs-chart-financial/dist/chartjs-chart-financial.min.js"></script>
<script src="path/to/chartjs-plugin-streaming/dist/chartjs-plugin-streaming.min.js"></script>