D3中的多个域用于扩展

时间:2015-04-29 12:19:55

标签: javascript d3.js gantt-chart

我想使用d3.js:

创建这种类型的标签
70008 a
      b
      c

70009 a
      b
      c

这可能吗?

目前我像这样创建y轴:

y = d3.scale.ordinal().domain(taskTypes).rangeRoundBands([0, SetSVGheight() - margin.top - margin.bottom], .1); 
yAxis = d3.svg.axis().scale(y).orient("left").tickSize(0);

这是我的数据数组:

{startDate : new Date( '2015-01-15T15:05:39.000' ),endDate : new Date( '2015-01-15T15:07:23.000' ),taskTypes: '72000',type : 'downtimes',dto_color : '#0000FF',},
{startDate : new Date( '2015-01-15T15:05:39.000' ),endDate : new Date( '2015-01-15T15:07:23.000' ),taskTypes: '72000',type : 'orders',dto_color : '#f2f2f2',},
{startDate : new Date( '2015-01-15T15:05:39.000' ),endDate : new Date( '2015-01-15T15:07:23.000' ),taskTypes: '72000',type : 'teams',dto_color : '#aaaaaa',},
{startDate : new Date( '2015-01-15T15:07:23.000' ),endDate : new Date( '2015-01-15T15:08:15.000' ),taskTypes: '70100',type : 'downtimes',dto_color : '#FF0000',},
{startDate : new Date( '2015-01-15T15:07:23.000' ),endDate : new Date( '2015-01-15T15:08:15.000' ),taskTypes: '70100',type : 'orders',dto_color : '#f2f2f2',},
{startDate : new Date( '2015-01-15T15:07:23.000' ),endDate : new Date( '2015-01-15T15:08:15.000' ),taskTypes: '70100',type : 'teams',dto_color : '#aaaaaa',},

如何将其他域添加到y轴?

0 个答案:

没有答案