-1

name mark1,mark2,mark3
raj,70,20,23
saran,45,70,20
sai,70,42,34

this is my csv file data...i have to draw areaplot using d3.js..i need paths based on row.is it possible to draw area plot using d3.js? please refer some code the paths based on each row.....and end of the path i have to set circle and text

Sai Rajesh
  • 1,882
  • 5
  • 22
  • 41

1 Answers1

0

C3 (since you tagged it) will let you do it like this:

var categories = ['Mark 1', 'Mark2', 'Mark 3'];
var chart = c3.generate({
    data: {
        columns: [
            ['raj',70,20,23],
            ['saran',45,70,20],
            ['sai', 70,42,34]

        ],
        type: 'area',
        //labels: true, // labels for all points
        labels: {
            format: function (v, id, i, j) { 
                return (i === categories.length - 1) ? id + v : ""; 
            },
        }
    },
    axis: {
      x: {
          tick: {
              format: function(x) { return categories[x]; }
          }
          //type: 'category',   // this way introduces a lot of padding
        //categories: ['Mark 1', 'Mark2', 'Mark 3']
      }
    }
});

It's easy enough to look up the c3 example page and find the details - http://c3js.org/examples.html

mgraham
  • 6,147
  • 1
  • 21
  • 20