diff --git a/babel_src/chartTimelineZoomable.js b/babel_src/chartTimelineZoomable.js index 64f4abe..fb51f65 100644 --- a/babel_src/chartTimelineZoomable.js +++ b/babel_src/chartTimelineZoomable.js @@ -119,9 +119,9 @@ class ChartTimelineZoomable { .attr('fill', 'white'); this.monthLabel - .attr('text-anchor', 'middle') + .attr('text-anchor', 'start') .attr('alignment-baseline', 'middle') - .attr('transform', 'translate(' + margin.left + ' ' + (height - margin.bottom - 40) + ') scale(1.5)') + .attr('transform', 'translate(' + (width * 0.03) + ' ' + (height - margin.bottom - 40) + ') scale(1.5)') .text(isChoosingMonth? '' : defaultDate.getMonth()+1+'月'); this.cityLabel diff --git a/public/javascripts/chartTimelineZoomable.js b/public/javascripts/chartTimelineZoomable.js index 51a151f..adfe967 100644 --- a/public/javascripts/chartTimelineZoomable.js +++ b/public/javascripts/chartTimelineZoomable.js @@ -127,7 +127,7 @@ var ChartTimelineZoomable = function () { // update chart content this.backgroudLine.attr('transform', 'translate(' + margin.left + ' ' + (height - margin.bottom) + ')').attr('width', width - margin.right - margin.left).attr('height', '1').attr('fill', 'white'); - this.monthLabel.attr('text-anchor', 'middle').attr('alignment-baseline', 'middle').attr('transform', 'translate(' + margin.left + ' ' + (height - margin.bottom - 40) + ') scale(1.5)').text(isChoosingMonth ? '' : defaultDate.getMonth() + 1 + '月'); + this.monthLabel.attr('text-anchor', 'start').attr('alignment-baseline', 'middle').attr('transform', 'translate(' + width * 0.03 + ' ' + (height - margin.bottom - 40) + ') scale(1.5)').text(isChoosingMonth ? '' : defaultDate.getMonth() + 1 + '月'); this.cityLabel.attr('text-anchor', 'start').attr('alignment-baseline', 'middle').attr('transform', 'translate(' + (margin.left + 100) + ' ' + (height - margin.bottom - 40) + ') scale(1)').text(city.province == null ? '' : city.province + ' ' + city.city); diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index 787047e..42d1440 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -140,15 +140,6 @@ li{ height: auto; z-index: 10; } -#mode-selector>select{ - background:none; - width: 10vw; - margin: 5px; - line-height:28px; - border: none; - text-align: left; - font-size: 2.5vw; -} .btn-dirt.selected, .btn-attr.selected { outline: none; @@ -280,5 +271,12 @@ li{ } #year-select { + background:none; + width: 10vw; + margin: 5px; + line-height:28px; + border: none; + text-align: left; font-weight: bold; + font-size: 3.2vw; } \ No newline at end of file