block by aaizemberg 03f518eee62b22d7f4c5

testing c3js

Full Screen

index.html

<!DOCTYPE html>
<html>
<head>
<!--d3.js -->
  <script src="//d3js.org/d3.v3.min.js"></script>

<!--c3.js -->
  <script src="https://rawgit.com/masayuki0812/c3/master/c3.js"></script>
  <link href="https://rawgit.com/masayuki0812/c3/master/c3.css" rel="stylesheet" type="text/css" />

  <meta charset="utf-8">
<title>testing c3</title>
</head>
<body>
  <div id="chart"></div>

<script>
var chart = c3.generate({
    data: {
      url: 'https://gist.githubusercontent.com/aaizemberg/03f518eee62b22d7f4c5/raw/3181d2be8a44d40fd4b3875f4b2f2880106301f0/data.csv',
        x: 'x',
//      xFormat: '%Y-%m-%d'
  },
  tooltip: {
    grouped: false
  },
  color: {
    pattern: ['#e41a1c', '#377eb8', '#4daf4a']
  },
  axis: {
    y: { 
      show: false 
    },
    x: {
      type: 'timeseries',
      tick: { 
        format: '%d/%m',
        count: 7
      }
    }
  }
});  
</script>  
  
</body>
</html>

data.csv

x,macri,massa,scioli
2015-01-01,17,17,0
2015-01-02,45,15,18
2015-01-03,18,9,68
2015-01-04,23,36,100
2015-01-05,25,25,91
2015-01-06,41,18,95
2015-01-07,16,13,48
2015-01-08,17,38,49
2015-01-09,17,25,37
2015-01-10,38,38,84
2015-01-11,40,74,80
2015-01-12,34,29,32
2015-01-13,26,10,12
2015-01-14,33,35,39
2015-01-15,15,18,23
2015-01-16,45,21,12
2015-01-17,80,9,9
2015-01-18,51,30,19
2015-01-19,22,18,20
2015-01-20,30,15,17
2015-01-21,3,6,11
2015-01-22,0,11,15
2015-01-23,24,19,7
2015-01-24,6,25,10
2015-01-25,0,6,31
2015-01-26,23,10,16
2015-01-27,24,8,8
2015-01-28,25,12,11
2015-01-29,8,18,8
2015-01-30,4,10,7
2015-01-31,68,4,8
2015-02-01,60,23,12
2015-02-02,66,18,9
2015-02-03,52,39,24
2015-02-04,19,15,11
2015-02-05,17,15,12
2015-02-06,21,11,24
2015-02-07,23,25,16
2015-02-08,40,32,21
2015-02-09,30,24,11
2015-02-10,29,45,21
2015-02-11,25,62,19
2015-02-12,15,19,11
2015-02-13,11,5,16
2015-02-14,10,4,22
2015-02-15,16,18,15
2015-02-16,7,12,13
2015-02-17,10,9,5
2015-02-18,8,13,9
2015-02-19,29,31,11
2015-02-20,14,22,11
2015-02-21,61,16,17
2015-02-22,36,39,19
2015-02-23,50,28,21
2015-02-24,42,21,26
2015-02-25,38,9,16
2015-02-26,15,30,18
2015-02-27,11,15,19
2015-02-28,49,24,25
2015-03-01,72,17,17
2015-03-02,30,16,39
2015-03-03,17,18,41
2015-03-04,25,12,27
2015-03-05,44,8,40
2015-03-06,52,32,22
2015-03-07,49,47,36
2015-03-08,41,32,50
2015-03-09,42,29,33
2015-03-10,31,26,26