diff --git a/src/data.js b/src/data.js index eaccba9..91222cd 100644 --- a/src/data.js +++ b/src/data.js @@ -70,7 +70,11 @@ export function readxml(xmldoc) { coverage: cloudCover[i] }) precipData.push({ - date: midpointTime, + date: startTimes[i], + probability: precip[i] + }) + precipData.push({ + date: endTimes[i], probability: precip[i] }) } diff --git a/src/index.js b/src/index.js index 0f80240..23a4087 100644 --- a/src/index.js +++ b/src/index.js @@ -26,8 +26,8 @@ const render = function (data) { const height = canvas.node().getBoundingClientRect().height const calHeight = 20 - const astroHeight = 50 - const tempHeight = 300 + const astroHeight = 45 + const tempHeight = 200 const cloudHeight = height - (calHeight +tempHeight + astroHeight) render_calendar(canvas, width, calHeight, 0, data) diff --git a/src/render.js b/src/render.js index 76bcd86..38797e2 100644 --- a/src/render.js +++ b/src/render.js @@ -293,7 +293,7 @@ export function render_temperature(canvas, width, height, offset, data) { bottom: 5, right: 0 } - const yrange = [-15, 45] + const yrange = [-5, 40] const chart = new Chart(canvas, width, height, offset, margin, data, yrange) const line = d3.line() @@ -302,8 +302,8 @@ export function render_temperature(canvas, width, height, offset, data) { .curve(d3.curveBasis) chart.draw_yAxisTitle('Temperature') - chart.set_yAxisTic(-10, '-10 °C') - chart.draw_xGrid( -10, 'guide') + //chart.set_yAxisTic(-10, '-10 °C') + //chart.draw_xGrid( -10, 'guide') chart.set_yAxisTic( 0, '0 °C') chart.draw_xGrid( 0, 'zero') chart.set_yAxisTic( 12, '12 °C')