File tree Expand file tree Collapse file tree
site/src/components/HomeDailyChart/generator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -320,12 +320,12 @@ const render = async ({ mobile } = { mobile: false }) => {
320320
321321 const axisStepMinDistance = width * 0.1 ;
322322 const xAxisPoints = xAxisSteps . reduce ( ( points , stepValue ) => {
323- const idx = Math . min ( stepValue , data . chart . length - 1 ) ;
323+ const idx = Math . min ( stepValue - 1 , data . chart . length - 1 ) ;
324324 const point : [ number , number ] = [
325325 x ( data . chart [ idx ] . date ) as number ,
326326 y ( data . chart [ idx ] . value ) as number ,
327327 ] ;
328- const lastPointX = points [ points . length - 1 ] ?. [ 0 ] ?? 0 ;
328+ const lastPointX = points [ points . length - 1 ] ?. [ 0 ] ?? - Infinity ;
329329 // don't allow axis ticks too close together, particularly
330330 // near the right-side end where TODAY takes up more space
331331 if ( point [ 0 ] < lastPointX + axisStepMinDistance ) {
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ const addAxisTickLabel =
7676 } ) => {
7777 svg
7878 . append ( "text" )
79- . attr ( "x" , x - 10 )
79+ . attr ( "x" , x )
8080 . attr ( "y" , height + 30 )
8181 . attr ( "fill" , "#777" )
8282 . attr ( "text-anchor" , "middle" )
You can’t perform that action at this time.
0 commit comments