|
132 | 132 | var x = d3.time.scale.utc()
|
133 | 133 | .domain(setup.domain)
|
134 | 134 | .nice(d3.time.month)
|
135 |
| - .rangeRound([0, setup.width],0.5); |
| 135 | + .rangeRound([0, setup.width+10],0.5); |
136 | 136 |
|
137 | 137 | var y = d3.scale.linear()
|
138 | 138 | .domain([0, d3.max(data, function(d) { return d.sum; })])
|
|
210 | 210 | .text(setup.firstLabel)
|
211 | 211 | .style("font-size", "13px");
|
212 | 212 |
|
213 |
| - chart.append("text") |
214 |
| - .attr("class", "label") |
215 |
| - .attr("text-anchor", "middle") |
216 |
| - .attr("transform", "translate(" + (last_tick - 11) + "," + (height + 18) + "), rotate("+rotate+")") |
217 |
| - .text(setup.lastLabel) |
218 |
| - .style("font-size", "13px"); |
| 213 | + if(setup.length > 1){ |
| 214 | + chart.append("text") |
| 215 | + .attr("class", "label") |
| 216 | + .attr("text-anchor", "middle") |
| 217 | + .attr("transform", "translate(" + (last_tick - 11) + "," + (height + 18) + "), rotate("+rotate+")") |
| 218 | + .text(setup.lastLabel) |
| 219 | + .style("font-size", "13px"); |
| 220 | + } |
219 | 221 |
|
220 | 222 | chart.selectAll("rect").each(
|
221 | 223 | function(d) {
|
@@ -360,15 +362,15 @@ $(document).ready(function(e) {
|
360 | 362 | // citations = [
|
361 | 363 | // // {id: "2009", title: "April 2018", sum: 337},
|
362 | 364 | // // {id: "2010", title: "April 2018", sum: 337},
|
363 |
| - // // {id: "2011", title: "April 2018", sum: 337}, |
364 |
| - // // {id: "2012", title: "April 2018", sum: 12}, |
365 |
| - // // {id: "2013", title: "April 2018", sum: 337}, |
366 |
| - // // {id: "2014", title: "April 2018", sum: 337}, |
367 |
| - // // {id: "2015", title: "April 2018", sum: 1000}, |
368 |
| - // // {id: "2016", title: "April 2018", sum: 337}, |
369 |
| - // // {id: "2017", title: "April 2018", sum: 23}, |
370 |
| - // // {id: "2018", title: "April 2018", sum: 337}, |
371 |
| - // // {id: "2019", title: "April 2018", sum: 337} |
| 365 | + // {id: "2011", title: "April 2018", sum: 337}, |
| 366 | + // {id: "2012", title: "April 2018", sum: 12}, |
| 367 | + // {id: "2013", title: "April 2018", sum: 337}, |
| 368 | + // {id: "2014", title: "April 2018", sum: 337}, |
| 369 | + // {id: "2015", title: "April 2018", sum: 1000}, |
| 370 | + // {id: "2016", title: "April 2018", sum: 337}, |
| 371 | + // {id: "2017", title: "April 2018", sum: 23}, |
| 372 | + // {id: "2018", title: "April 2018", sum: 337}, |
| 373 | + // {id: "2019", title: "April 2018", sum: 337} |
372 | 374 | // ]
|
373 | 375 |
|
374 | 376 | if(views){bar2Viz(views,"#views-chart","sum","months","full",yop); }
|
|
0 commit comments