Skip to content

Commit

Permalink
[ICIJ/datashare#399][insights] Recalculate x and y scales for WidgetC…
Browse files Browse the repository at this point in the history
…reationDateOverTime
  • Loading branch information
annelhote committed Mar 13, 2020
1 parent 8674fd7 commit dc1aa97
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/components/WidgetCreationDateOverTime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,11 @@ export default {
},
buildChart () {
// Create the x axis
const xAxis = d3.select('.axis-x').call(
d3.axisBottom(this.x)
.tickValues(this.data.map(d => d.date))
.tickFormat(d3.timeFormat('%m-%Y')))
const xAxis = d3.select('.axis-x').call(d3.axisBottom(this.x))
xAxis.selectAll('.tick text')
.attr('transform', 'translate(20, 20) rotate(45)')
// Create the y axis
d3.select('.axis-y').call(
d3.axisLeft(this.y)
.ticks())
d3.select('.axis-y').call(d3.axisLeft(this.y))
},
async init () {
this.data = await this.loadData()
Expand Down

0 comments on commit dc1aa97

Please sign in to comment.