Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Add test for highlight problem with chxr values when you passed :axis_ran #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions spec/gchart_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@
:bar_colors => ['FD9A3B', '4BC7DC']).should include("chxr=0,-20,100")
end

it "with scaled values should provide the chxr good values" do
x_min, x_max, x_step = 0, 3, 1
y_min, y_max, y_step = 0, 80, 10
scale = [0,100]
data = [[0,25,10,15],[50,60,80,30]]
Gchart.line( :data => data,
:encoding => 'text',
:axis_range => [[x_min,x_max,x_step],[y_min,y_max,y_step]],
:min_value => scale[0],
:max_value => scale[1]).include?("chxr=0,#{x_min},#{x_max},#{x_step}|1,#{y_min},#{y_max},#{y_step}").should be_true
end

it "should be able to have multiple set of data with text encoding" do
Gchart.line(:data => [[10, 5.2, 4, 45, 78], [20, 40, 70, 15, 99]], :encoding => 'text').include?(Gchart.jstize('chd=t:10,5.2,4,45,78|20,40,70,15,99')).should be_true
end
Expand Down