|
116 | 116 | let formatFixed = d3.format(",.0f");
|
117 | 117 | let formatTime = d3.time.format.utc("%H:%M:%S");
|
118 | 118 | let height = 200
|
119 |
| - var margin = { top: 10, right: 20, bottom: 20, left: 20 }; |
| 119 | + var margin = { top: 10, right: 20, bottom: 30, left: 20 }; |
120 | 120 |
|
121 | 121 | let chartWidth = document.getElementById("myTabContent").offsetWidth*0.95
|
122 | 122 | if(displayMode == "citations"){
|
|
147 | 147 | .data([data])
|
148 | 148 | .attr("width", margin.left + setup.width + margin.right)
|
149 | 149 | .attr("height", margin.top + height + margin.bottom)
|
150 |
| - .attr("style","position:relative") |
| 150 | + .attr("style","position:relative;") |
151 | 151 | .attr("class", "chart barchart")
|
152 | 152 | .append("svg:g")
|
153 | 153 | .attr("transform", "translate(" + margin.left + "," + margin.top + ")");
|
|
198 | 198 | last_tick = chart.selectAll("rect").pop().pop().x.animVal.value
|
199 | 199 | }
|
200 | 200 |
|
201 |
| - |
202 |
| - |
| 201 | + var rotate = "0" |
| 202 | + if(setup.length < 4){ |
| 203 | + rotate = "-65" |
| 204 | + } |
203 | 205 |
|
204 | 206 | chart.append("text")
|
205 | 207 | .attr("class", "label")
|
206 | 208 | .attr("text-anchor", "middle")
|
207 |
| - .attr("transform", "translate(11," + (height + 18) + ")") |
| 209 | + .attr("transform", "translate(11," + (height + 18) + "), rotate("+rotate+")") |
208 | 210 | .text(setup.firstLabel)
|
209 | 211 | .style("font-size", "13px");
|
210 | 212 |
|
211 | 213 | chart.append("text")
|
212 | 214 | .attr("class", "label")
|
213 | 215 | .attr("text-anchor", "middle")
|
214 |
| - .attr("transform", "translate(" + (last_tick - 11) + "," + (height + 18) + ")") |
| 216 | + .attr("transform", "translate(" + (last_tick - 11) + "," + (height + 18) + "), rotate("+rotate+")") |
215 | 217 | .text(setup.lastLabel)
|
216 | 218 | .style("font-size", "13px");
|
217 | 219 |
|
@@ -353,20 +355,20 @@ $(document).ready(function(e) {
|
353 | 355 | // {id: "2019-08", title: "April 2018", sum: 337},
|
354 | 356 | // ]
|
355 | 357 |
|
356 |
| - // yop="1980" |
| 358 | + // yop="2000" |
357 | 359 |
|
358 | 360 | // citations = [
|
359 |
| - // {id: "2009", title: "April 2018", sum: 337}, |
360 |
| - // {id: "2010", title: "April 2018", sum: 337}, |
361 |
| - // {id: "2011", title: "April 2018", sum: 337}, |
362 |
| - // {id: "2012", title: "April 2018", sum: 12}, |
363 |
| - // {id: "2013", title: "April 2018", sum: 337}, |
364 |
| - // {id: "2014", title: "April 2018", sum: 337}, |
365 |
| - // {id: "2015", title: "April 2018", sum: 1000}, |
366 |
| - // {id: "2016", title: "April 2018", sum: 337}, |
367 |
| - // {id: "2017", title: "April 2018", sum: 23}, |
368 |
| - // {id: "2018", title: "April 2018", sum: 337}, |
369 |
| - // {id: "2019", title: "April 2018", sum: 337} |
| 361 | + // // {id: "2009", title: "April 2018", sum: 337}, |
| 362 | + // // {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} |
370 | 372 | // ]
|
371 | 373 |
|
372 | 374 | if(views){bar2Viz(views,"#views-chart","sum","months","full",yop); }
|
|
0 commit comments