C3Js Testing Sample

Scratch pad for trying bits

by Daniel Buttery

HTML

<script src="https://rawgit.com/masayuki0812/c3/master/c3.js"></script>
<link rel="stylesheet" href="https://rawgit.com/masayuki0812/c3/master/c3.css">
<div id="chart2"></div>

CSS

.c3-tooltip {
  font-family: Roboto
}

JavaScript

var chart = c3.generate({
  bindto: document.getElementById('chart2'),
  data: {
    x: 'date',
    rows: [
      ["date", "Jeb", "Bob", "Dan", "Steve", "Ned", "Carol"],
      ['2016-1-1', 460, 426, 625, 66, 687, 417],
      ['2016-1-2', 83, 316, 49, 0, 689, 656],
      ['2016-1-3', 63, 195, 304, 441, 559, 476],
      ['2016-1-4', 77, 301, 204, 523, 104, 670],
      ['2016-1-5', 505, 599, 125, 498, 40, 259],
      ['2016-1-6', 295, 46, 21, 344, 581, 144],
      ['2016-1-7', 152, 619, 252, 672, 155, 41],
      ['2016-1-8', 543, 66, 167, 489, 171, 62],
      ['2016-1-9', 31, 449, 619, 261, 205, 211],
      ['2016-1-10', 5, 527, 173, 304, 459, 280],
      ['2016-1-11', 663, 85, 31, 363, 573, 186],
      ['2016-1-12', 550, 172, 466, 231, 491, 110],
      ['2016-1-13', 97, 528, 598, 85, 192, 75],
      ['2016-1-14', 332, 697, 668, 593, 18, 469],
      ['2016-1-15', 577, 611, 443, 384, 596, 188],
      ['2016-1-16', 130, 503, 216, 637, 397, 370],
      ['2016-1-17', 294, 113, 408, 4, 400, 416],
      ['2016-1-18', 170, 183, 1, 274, 551, 670],
      ['2016-1-19', 599, 628, 456, 443, 302, 58],
      ['2016-1-20', 428, 277, 670, 659, 166, 135],
      ['2016-1-21', 236, 298, 561, 624, 105, 200],
      ['2016-1-22', 555, 489, 16, 177, 72, 551],
      ['2016-1-23', 159, 42, 113, 193, 288, 637],
      ['2016-1-24', 237, 157, 243, 647, 545, 273],
      ['2016-1-25', 438, 630, 63, 72, 63, 402],
      ['2016-1-26', 188, 630, 336, 96, 159, 700],
      ['2016-1-27', 244, 12, 281, 576, 625, 629],
      ['2016-1-28', 318, 484, 570, 205, 373, 551],
      ['2016-1-29', 617, 396, 572, 72, 142, 483],
      ['2016-1-30', 126, 126, 303, 261, 23, 140],
      ['2016-1-31', 505, 205, 603, 105, 364, 295],
      ['2016-2-1', 125, 555, 543, 64, 645, 134],
      ['2016-2-2', 274, 102, 61, 3, 11, 659],
      ['2016-2-3', 464, 352, 579, 335, 99, 128],
      ['2016-2-4', 192, 370, 6, 104, 576, 418],
      ['2016-2-5', 508, 200, 313, 542, 122, 344],
      ['2016-2-6', 337, 354, 617, 698, 696, 313],
...