diff --git a/charts.factor b/charts.factor index b643ca1f70..2d90d984d2 100644 --- a/charts.factor +++ b/charts.factor @@ -83,7 +83,7 @@ PRIVATE> ! Return the bottom-left and top-right corners of the visible area. : chart-axes ( chart -- seq ) - drop { { 0 300 } { 300 0 } } ; + drop { { 0 300 } { 0 300 } } ; ! There are several things to do to present data on the screen. ! Map the data coordinates to the screen coordinates. @@ -92,9 +92,9 @@ PRIVATE> M: line draw-gadget* dup parent>> dup chart? [ - chart-axes drop - [ color>> gl-color ] - [ data>> draw-line ] bi + chart-axes swap + [ color>> gl-color ] [ data>> ] bi + clip-data [ draw-line ] unless-empty ] [ 2drop ] if ; ! chart new line new COLOR: blue >>color { { 0 100 } { 100 0 } { 100 50 } { 150 50 } { 200 100 } } >>data add-gadget gadget.