topfunky / gruff

Gruff graphing library for Ruby

Home Page:http://gruff.rubyforge.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

line_width in Line makes no difference

fenelon opened this issue · comments

The test test_line_large_values draws 1px lines.

I've got homebrew imagemagick 6.9.5-4.

rake test fails with:

 test_webp#TestGruffLine (18.32s)
        Expected /no encode delegate for this image format .*\.webp/ to match # encoding: ASCII-8BIT
        "delegate failed `'cwebp' -quiet -q %Q '%i' -o '%o'' @ error/delegate.c/InvokeDelegate/1919".
        /xxx/gruff/test/test_line.rb:597:in `rescue in test_webp'
        /xxx/gruff/test/test_line.rb:593:in `test_webp'

The test itself:

  def test_line_large_values
    @datasets = [
        [:large, [100_005, 35_000, 28_000, 27_000]],
        [:large2, [35_000, 28_000, 27_000, 100_005]],
        [:large3, [28_000, 27_000, 100_005, 35_000]],
        [:large4, [1_238, 39_092, 27_938, 48_876]]
    ]

    g = Gruff::Line.new
    g.title = 'Very Large Values Line Graph Test'
    g.baseline_value = 50_000
    g.baseline_color = 'green'
    g.dot_radius = 15
    g.line_width = 5
    g.dot_style = :square
    puts g.inspect
    @datasets.each do |data|
      g.data(data[0], data[1])
    end

    g.write('line_large1.png')
  end

The resulting image:
line_large

Found a problem in stroke-opacity setting. Patched with #158

Seems that this problem no longer reappear.