Skip to content
a JavaScript library for rendering candlestick charts using the canvas element
JavaScript Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


DojiChart is a JavaScript library for displaying candlestick charts and technical indicators using the canvas element.


npm install dojichart


  • Multiple chart panels - A DojiChart instance comprises multiple chart panels, for example, a separate volume panel can be associated with a price chart panel.

  • Layers - A chart panel has layers, for example a candlestick layer and moving average layer.

  • Responsive - Charts are responsive, such that they expand or contract to fit their container's width.

  • Size and spacing - The width of candlesticks and their intervals can be changed on the fly - this is equivalent to zooming.

  • Scrolling - Charts can be scrolled forward and backward, either one bar at a time or by a specific number of time intervals.

  • Grid lines and labels - Each chart panel can optionally have value and time grid lines and labels, which can be set to appear at specified granularity or automatically.

  • Crosshair - A crosshair, implemented as a layer is rendered over each chart panel and reacts to mousemove events.

  • Events - Click events on candlesticks is implemented and can be extended to cover other interaction events, such as touch and drag.


Include the DojiChart CSS and JavaScript in the head of your HTML document:

<link rel="stylesheet" href="dojichart.min.css">
<script type="text/javascript" src="dojichart.min.js"></script>

Provide an HTML container element:

<div class="dojichart" id="mychart">
  <div class="region" data-name="price"></div>

Instantiate the DojiChart instance, create a panel, add a layer and load some data:

var dojichart = new DojiChart.core.Chart(document.getElementById('mychart'), {
  fieldMap: {
    time: 't',
    open: 'o',
    high: 'h',
    low: 'l',
    close: 'c'

// Create a chart panel with a candlestick chart layer
var price_chart_panel = new DojiChart.panel.TimeValuePanel({
  primaryLayer: new DojiChart.layer.CandleLayer(),
  height: 200

// Render the panel in the region named 'price'
dojichart.addComponent('price', price_chart_panel);

// Dummy data
var data_arr = [

// Load data
dojichart.loadData(data_arr, 'EURUSD', 'M5');


DojiChart is made available via the GNU General Public License version 3 (GPLv3). You are required to release the source code of any program that you distribute that uses DojiChart. If you would like to use the DojiChart source as part of commercial software or do not want disclose your source code, please get in contact.

You can’t perform that action at this time.