February 2019
Beginner to intermediate
284 pages
6h 20m
English
You can render several different charts on the same page by simply drawing a separate Canvas for each one.
The following example displays four charts on one page that share the same data. First, we need to set up the canvases using HTML and CSS:
<html lang="en"><head> <script src=".../Chart.min.js"></script> <style> .container { width: 98%; height: 80vh; position: absolute; } .top { height:50%; position: relative; } .col { width: 50%; position: absolute; } .col:nth-child(2n-1) { left: 50%; } .footer { height: 50%; position: relative; } </style> </head> <body> <div class="container"> <div class="top" width="400" height="200"> <div class="col"><canvas id="chart1"></canvas></div> <div class="col"><canvas id="chart2"></canvas></div> ...Read now
Unlock full access