Skip to content
On this page

Charts > Timeline ​

A timeline visually represents events or milestones chronologically over a specific period, providing a clear and linear overview of temporal relationships.

The Chart ​

Value:

Download example CSV
Copy HTML

Playground ​

Style

Fill color for circles
Color of border of circles
Color of ref line

Usage Example (with tooltip) ​

vue
<template>
  <Timeline :data="data" @hover="setTooltip" />

  <OTTooltip :info="tooltip">
    <p class=" my-0">
      <span class="font-semibold"> Value:</span> {{ tooltip?.data?.value }}
    </p>
  </OTTooltip>
</template>

<script setup>
import useTooltip from "@/functions/useTooltip.js";

const [tooltip, setTooltip] = useTooltip();
</script>

Component API ​

This chart is built using SVG and d3. It displays data elements on a timeline. The size of the circles is based on the values. The date property of the elements in the data array should be a Date object.

Data ​

js
[
  {
    name: "Data 1",
    date: new Date("2020-09-01"),
    value: 30,
  },
];

Props ​

NameDefaultDescriptionType
data[]The datasetArray
color#BDCCDFThe fill color of the circlesString
strokeColor#4267BFThe color of the borderString
of circles
lineColor#D1D5DBThe color of the reference lineString

Dependencies ​

  • d3