jiahuang / d3-timeline

Simple JS timeline plugin for d3
1.03k stars 282 forks source link

No labels on gant chart #61

Closed SteveStrong closed 9 years ago

SteveStrong commented 9 years ago

Looks like the gant chart examples do not show labels on the left. This is shown in the PNG's but none of these examples show code that will product the picture

           var labelTestData = [ 
             {label: "person a", times: [{"starting_time": 1355752800000, "ending_time": 1355759900000}, {"starting_time": 1355767900000, "ending_time": 1355774400000}]}, 
             {label: "person b", times: [{"starting_time": 1355759910000, "ending_time": 1355761900000}, ]}, 
             {label: "person c", times: [{"starting_time": 1355761910000, "ending_time": 1355763910000}]}, 
            ];
patte commented 9 years ago

+1

awsp commented 9 years ago

Got the same problem.

Not sure if it is intended or a bug, to correctly display text value, you will need to provide a format function for label.

For example,

d3.timeline().stack().labelFormat(function(label){
  return label;
})

Update It seems there is a pull request for this issue as well. https://github.com/jiahuang/d3-timeline/pull/62/files

jiahuang commented 9 years ago

Sorry for the wait, been out of the country. I've merged that PR.