app/assets/javascripts/plasticine/column.coffee in plasticine-1.2.1 vs app/assets/javascripts/plasticine/column.coffee in plasticine-1.2.2
- old
+ new
@@ -112,31 +112,35 @@
@xAxis = d3.axisBottom(@xScale)
@xAxis.tickSize -@holder.height()
switch @xAxisFormat
when 'date' then @xAxis.tickFormat(d3.timeFormat('%b'))
+ when 'day' then @xAxis.tickFormat(d3.timeFormat('%e-%m'))
when 'quarter' then @xAxis.tickFormat (d) => PlasticineHelpers.toQuarter(d, @quarterStartMonth)
when 'year' then @xAxis.tickFormat (d) => PlasticineHelpers.toYear(d, @quarterStartMonth)
when 'money' then @xAxis.tickFormat (d) => PlasticineHelpers.toPrice(d)
+ when 'numeric' then @xAxis.tickFormat (d) => PlasticineHelpers.toNumeric(d)
setXScaleRange: () ->
columnsMargin = @holder.data('columns-margin')
columnsLeftPadding = @holder.data('columns-left-padding')
columnsRightPadding = @holder.data('columns-right-padding')
width = @holderWidth()
-
+
@xScale = @xScale.rangeRound([columnsLeftPadding, width - columnsRightPadding]).padding(columnsMargin);
setYAxis: () ->
@yAxis = d3.axisLeft(@yScale)
@yAxis.tickSize -@holderWidth()
@yAxis.ticks @yAxisTickCount
switch @yAxisFormat
when 'date' then @yAxis.tickFormat(d3.timeFormat('%b'))
+ when 'day' then @yAxis.tickFormat(d3.timeFormat('%e %b'))
when 'money' then @yAxis.tickFormat (d) => PlasticineHelpers.toPrice(d)
+ when 'numeric' then @yAxis.tickFormat (d) => PlasticineHelpers.toNumeric(d)
showTooltip: (bar, data) ->
barNode = $($(bar).find('rect:last-child')[0])
barX = $(bar).attr('x')