複数の軸を持つこのチャートがあります。
Ruby gemlazy_high_charts
でコーディングされていますが、Highcharts との違いは Ruby の構文だけです。
私の問題は、値が10を超えることはないため、最初yAxis
に を設定したことです。ただし、何らかの理由で、これは無視されています。:max => 10
何か案は?
@rating_development = LazyHighCharts::HighChart.new('graph') do |f|
f.title(:text => "Some title")
f.xAxis(:categories => categories, :tickInterval => categories.size / 10, :labels => {:y => 27})
f.series(:name => "1st thing", :color => "#000000", :lineWidth => 4, :yAxis => 0, :data => first_data_set, :marker => { :enabled => false })
f.series(:name => "2nd thing", :color => "#0030ff", :yAxis => 1, :data => second_data_set, :marker => { :enabled => false }, :dash_style => 'shortdot')
f.series(:name => "3rd thing", :color => "#ff0006", :yAxis => 2, :data => third_data_set, :marker => { :enabled => false }, :dash_style => 'shortdot')
f.yAxis [
{:title => {:text => "1st thing", :style => {:color => "#000000"}}, :tickInterval => 1, :max => 10, :plotBands => [{:color => '#af0000', :from => 0, :to => 3}, {:color => '#df7000', :from => 3, :to => 5}, {:color => '#f4d600', :from => 5, :to => 7}, {:color => '#87b014', :from => 7, :to => 9}, {:color => '#5aa417', :from => 9, :to => 10}], :labels => {:style => {:color => "#000000"}}},
{:title => {:text => "2nd thing", :style => {:color => "#0030ff"}}, :opposite => true, :min => 0, :labels => {:style => {:color => "#0030ff"}}},
{:title => {:text => "3rd thing", :style => {:color => "#ff0006"}}, :opposite => true, :min => 0, :labels => {:style => {:color => "#ff0006"}}}
]
f.legend(:enabled => false)
end