Lazyhighchart cartesian plane

97 views Asked by At

I am sure it exist a command to do what I want but I can not find it. I have an array vgtv=[2.1,18.3,13.2] and an array v10=[15,107,106]. I use the lazyhighchart gem to show this result:

@chartV10vsVgtv = LazyHighCharts::HighChart.new('graph') do |f|
  f.title(:text => "V10 vs Vgtv")
  f.xAxis(:categories => vgtv,:title => {:text => "Vgtv", :margin => 10})
  f.series(:name => "All Patients",:yAxis => 0, :lineWidth => 0, :data => v10)
  f.yAxis [{:title => {:text => "V10", :margin => 10} }]
  f.legend(:align => 'right', :verticalAlign => 'top', :y => 75, :x => -50, :layout => 'vertical',)
  f.chart({:defaultSeriesType=>"line"})
  f.options[:plotOptions]={areaspline:{pointInterval: 2, pointStart: 0}}
end    

This command will plot 3 points equal spaced in the xaxis in the order (2.1,15),(18.3,107),(13.2,106). What I want is to display this points as into a cartesian plane i.e

-they should not be equal spaced in the xaxis but must be spaced depending on the value on this axis e.g between (2.1,15) and (18.3,107) I want a space of 16.2 on x axis. Consequently they should display in the order (2.1,15),(13.2,106),(18.3,107).

I look for commands like 'cartesian' or something like that but I do not find anything. I try with plotOption areaspline but doesn't seems to work... Cheers

1

There are 1 answers

0
ToTo10 On

I found it. Data should be in the form

data: [[2.1, 15], [18.3, 107], [13.2, 106]]