Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/gruff/candlestick.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def draw_graph
minimum_value: minimum_value, maximum_value: maximum_value, spread: @spread
)

width = (@graph_width - calculate_spacing) / column_count
width = @graph_width / calculate_spacing
bar_width = width * @spacing_factor
padding = width - bar_width

Expand Down Expand Up @@ -115,9 +115,9 @@ def column_count
normalized_candlesticks.size
end

# @rbs return: Integer
# @rbs return: Float
def calculate_spacing
column_count - 1
column_count.to_f
end

# @rbs return: bool
Expand Down
4 changes: 2 additions & 2 deletions sig/generated/gruff/candlestick.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class Gruff::Candlestick < Gruff::Base
# @rbs return: Integer
def column_count: () -> Integer

# @rbs return: Integer
def calculate_spacing: () -> Integer
# @rbs return: Float
def calculate_spacing: () -> Float

# @rbs return: bool
def show_marker_vertical_line?: () -> bool
Expand Down
Binary file modified test/expected/candlestick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/expected/candlestick_empty_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/expected/candlestick_show_vertical_markers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/expected/candlestick_spacing_factor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.