Skip to content

Instantly share code, notes, and snippets.

@davidsf
Created September 28, 2011 14:19
Show Gist options
  • Save davidsf/1248059 to your computer and use it in GitHub Desktop.
Save davidsf/1248059 to your computer and use it in GitHub Desktop.
Highchart pointer
@graph_column = LazyHighCharts::HighChart.new('column') do |f|
f.series(:name=>'Correct',:data=> [1, 2, 3, 4, 5])
f.series(:name=>'Incorrect',:data=> [10, 2, 3, 1, 4] )
f.title({ :text=>"clickable bar chart"})
f.legend({:align => 'right',
:x => -100,
:verticalAlign=>'top',
:y=>20,
:floating=>"true",
:backgroundColor=>'#FFFFFF',
:borderColor=>'#CCC',
:borderWidth=>1,
:shadow=>"false"
})
f.options[:chart][:defaultSeriesType] = "column"
f.options[:x_axis] = {:plot_bands => "none", :title=>{:text=>"Time"}, :categories => ["1.1.2011", "2.1.2011", "3.1.2011", "4.1.2011", "5.1.2011"]}
f.options[:y_axis] = {:title => { :text=>"Answers"} }
f.options[:plotOptions][:column] = { :stacking=>'normal',
:cursor => 'pointer',
:point => {:events => {:click => "alert('fitetu');" }}
}
end
= high_chart("graph_column", @graph_column) do |c|
= "options.plotOptions.column.cursor = 'pointer'"
= "options.plotOptions.column.point.events.click = function() { location.href='http://www.hotmail.com'; }"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment