A simple Calendar Heatmap for jQuery | CalendarHeatmap

The Calendar Heat Map jQuery plugin allows for easy display of data such as contributions on a daily basis, indicating the number by color.

CalendarHeatmap.js is a jQuery plugin used to create a dynamic, interactive, and configurable calendar heat map for representing time series data. Hover over the slots to view details for each day on request. Inspired by the Github commitment calendar chart.

How to make use of it:

Installations:

# NPM
$ npm install calendarheatmap --save

# Bower
$ bower install calendarheatmap --save

1. Include the required jQuery JavaScript library and Moment.js on the webpage.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/cdn/moment.min.js"></script>

2. Include the jQuery CalendarHeatmap.js plugin widget after jQuery and moment.js.

<link rel="stylesheet" href="jquery.CalendarHeatmap.css">
<script src="jquery.CalendarHeatmap.min.js"></script>

3. Create a placeholder for the Calendar FlareMap/heatmap.

<div id="heatmap-demo"></div>

4. Prepare the information you need to update the calendar color representation map.

var data = [
    {count: 2, date: "2017-09-23"},
    {count: 1, date: "2017-10-23"},
    {count: 4, date: "2017-11-11"},
    {count: 5, date: "2017-11-13"},
    {count: 3, date: "2017-11-21"},
    ...
]

5. Visualize the information inside the calendar color representation map.

$("#heatmap-demo").CalendarHeatmap(data, {
  // options here
});

6. All default options to customize the calendar color representation map.

$("#heatmap-demo").CalendarHeatmap(data, {

  // title of the calendar heatmap
  title: null,

  // the number of months to display
  months: 12,

  // the first day of the week: 1 is Monday
  weekStartDay: 1,

  // or rounded, circle
  tiles: {
    shape: "square"
  },

  // last month
  lastMonth: moment().month() + 1,

  // last year
  lastYear: moment().year(),

  // color gradients
  coloring: null,

  // custom labels
  labels: {
    days: false,
    months: true,
    custom: {
      weekDayLabels: null,
      monthLabels: null
    }
  },

  // custom legend
  legend: {
    show: true,
    align: "right",
    minLabel: "Less",
    maxLabel: "More",
    divider: " to "
  },

  // custom tooltips
  // requires
  tooltips: {
    show: false,
    options: {}
  }
  
});

7. API Strategies.

// get currently selected dates
$("#heatmap-demo").CalendarHeatmap("getDates");

// update data
$("#heatmap-demo").CalendarHeatmap("updateDates", data);

// append additional data
$("#heatmap-demo").CalendarHeatmap("appendDates", data );

// get options
$("#heatmap-demo").CalendarHeatmap("getOptions");

// update options
$("#heatmap-demo").CalendarHeatmap("updateOptions" {
  // options here
});

Calendar Heatmap Plugin, Calendar Heat Map Github


See Demo And Download

Official Website(SeBassTian23): Click Here

This superior jQuery/javascript plugin is developed by SeBassTian23. For extra Advanced Usages, please go to the official website.

Related Posts

Cookie-Consent-Using-Bootstrap

How to Create a Simple Cookie Banner Consent Using Bootstrap 4

Cookie Consent Popup Javascript – Quick and simple tutorial for creating a simple Bootstrap cookie banner. If you have a website or blog with people visiting or…

Create-HTML-Terminals

Create Custom HTML Terminals With Pure JavaScript | shell.js

Custom HTML Terminals is A JavaScript library to create HTML terminals on web pages. The shell js JavaScript library offers a straightforward method to create Ubuntu, OS X,…

Bootstrap-Alert-Bootbox

Bootstrap Alert, Confirm, and Flexible Dialog Boxes | Bootbox

Bootbox.js is a small JavaScript library that allows you to create programming dialogs using Bootstrap templates, without having to worry about creating, managing, or removing any required…

Slider-fg-carousel

An Accessible Touch-enabled Slider Web Component | fg-carousel

fg-carousel Slider – A simple & modern slider web component to create versatile, accessible, touch-enabled picture carousels utilizing CSS scroll snap, Custom Element, and Intersection Observer API….

Tags-Input-Component

A Lightweight and Efficient Tags Input Component in Vanilla JS | tagify

tagify transforms an input field or textarea into a tags component, in an easy and customizable way, with great performance and a small code footprint, full of…

copy-to-clipboard-javascript

A Lightweight Library to Copy Text to Clipboard | CopyJS

CopyJS is a lightweight JavaScript library that allows you to copy plain text or HTML content to the clipboard. Must Read: Tiny Library for Copy Text In…