Veena
Veena

Reputation: 11

D3 Stacked bar chart

Hi I have created a vertical stacked bar chart . My data is in csv file. My x scale is ordinal.AS per the requirement my x scale should me time scale. what changes should I make to make my x axis time scale. I have only limited time to complete this. Here is my code

var x = d3.scale.ordinal()
     .rangeRoundBands([0, width], .1);


var xAxis = d3.svg.axis()
      .scale(x).ticks(5)
    .orient("bottom");  

Upvotes: 1

Views: 277

Answers (1)

BomberMan
BomberMan

Reputation: 1094

put here your CSV structure. most probably your solution is

 parse = d3.time.format("%H:%M:%S").parse,
 format = d3.time.format("%X");

where in your CSV file time column shoud be like : 'hour:minute:second' format.

and pass 'format' value on your axis

for precise answer put your code here! or else you can refer this

Upvotes: 2

Related Questions