chart.rb : modify set_up_down_bars
chart.rb : use write_lines_base in write_gridlines_base