Skip to content
This repository was 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
joel wants to merge 1 commit into
mattetti:masterfrom
joel:add_test_for_chxr
Open

Add test for highlight problem with chxr values when you passed :axis_ran#39
joel wants to merge 1 commit into
mattetti:masterfrom
joel:add_test_for_chxr

Conversation

@joel

@joel joel commented Jun 23, 2011

Copy link
Copy Markdown
Contributor

I add this test

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},#{scale[1]},#{x_step}|1,#{y_min},#{scale[1]},#{y_step}").should be_true
end

This test passed with success but it's not the expected behaviour

Expected behaviour must be

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

@aderyabin

Copy link
Copy Markdown
Collaborator

I think that is not a problem, its a feature. Look at this code https://github.com/mattetti/googlecharts/blob/master/lib/gchart.rb#L500

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants