Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

chartJS Timeline with images

const img = new Image(16, 16);
img.src = 'https://i.stack.imgur.com/Q94Tt.png'; 

var ctx = document.getElementById('chart').getContext('2d');
var myChart = new Chart(ctx, {
  type: 'line',
  data: {
    datasets: [{
      data: [
        { x: "2020-03-22", y: 0 },
        { x: "2020-04-01", y: 0 },
        { x: "2020-04-02", y: 0 },
        { x: "2020-04-03", y: 0 },
        { x: "2020-04-08", y: 0 },
        { x: "2020-04-12", y: 0 },
        { x: "2020-04-15", y: 0 }
      ],
      pointStyle: img,
      borderWidth: 1
    }]
  },
  options: {
    legend: {
      display: false
    },
    scales: {
      yAxes: [{
        ticks: {
          display: false,
        },        
        gridLines: {
          display: false
        }
      }],
      xAxes: [{
        type: 'time',
        time: {
          unit: 'day',
          tooltipFormat: 'MMM DD'
        },
        gridLines: {
          display:false
        }
      }]
    }
  }
});
Comment

chartJS Timeline with images

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.bundle.min.js"></script>
<canvas id="chart" height="28"></canvas>
Comment

PREVIOUS NEXT
Code Example
Javascript :: Decodes a string of data which has been encoded using base-64 encoding - Nodejs 
Javascript :: is an array that is in sorted order a min-heap 
Javascript :: pwa tabs chrome extension 
Javascript :: react native run on a particular emu 
Javascript :: divcontainer is null 
Javascript :: js try catch err.printstacktrace 
Javascript :: check if div is collpased jqeruy 
Javascript :: z-song laravel-admin unable load js fucntion untill use f5 
Javascript :: cdate ssrs expressions 
Javascript :: convert fetch promise to observable 
Javascript :: modulo operator multiples, alternate values 
Javascript :: oracle apex 20 show spinner by press button 
Javascript :: how to speak numbers in javascript 
Javascript :: 5.2.1. Loose Equality With ==¶ 
Javascript :: jssor js slider next prev arrows position 
Javascript :: add expressions 
Javascript :: js string get substring between two characters 
Javascript :: vs code { key to to go brace 
Javascript :: tableexport dates 
Javascript :: Using Math Functions in an IF statement 
Javascript :: react default value for props not showing up 
Javascript :: how to convert serilazed data to json in js 
Javascript :: undefined is not an object render header flatlist react hook 
Javascript :: delete all properties from an javascript object second solution 
Javascript :: vdio Javascript 
Javascript :: uselazyquery refetch from child 
Javascript :: country name based on browser 
Javascript :: map for id 
Javascript :: remove falsy values from object lodash 
Javascript :: VueJs System Modifier keys like exact ctrl alt shift meta 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =