Home Forums Chart Support Chart with Multiple Columns per Month Reply To: Chart with Multiple Columns per Month



You can categorize your data based on month and add an index for corresponding month to each datapoints. Please take a look at the code snippet below.

for(var i=0; i<csvData.length; i++) {
  var csvLines = csvData[i];
  if(!technicianData[csvLines.label]) {
    technicianData[csvLines.label] = [];

  if(typeof months[csvLines.month] === "undefined") {
    months[csvLines.month] = monthIndex;
    monthIndex += 1;
  technicianData[csvLines.label].push({ "label" : csvLines.month, y: csvLines.y, x: months[csvLines.month]});

var data = [];

for (var technician in technicianData ) {
  if (!technicianData.hasOwnProperty(technician)) continue;
  data.push({"name": technician, dataPoints: technicianData[technician]})

Also, check out this JSFiddle for complete working code.

Multi Series Column Chart with Categorized Data based on Month

Manoj Mohan
Team CanvasJS