require 'daru/view' require 'daru' Daru::View.plotting_library = :highcharts data = [ ['Firefox', 45.0], ['IE', 26.8], { :name=> 'Chrome', :y=> 12.8, :sliced=> true, :selected=> true }, ['Safari', 8.5], ['Opera', 6.2], ['Others', 0.7] ] plt_pie = Daru::View::Plot.new data, type: :pie # this is done automatically when `Daru::View.plotting_library = :highcharts` is done. # Daru::View.load_lib_in_iruby 'Highcharts' plt_pie.show_in_iruby plt_pie.div chart_options = {:defaultSeriesType=>"pie" , :margin=> [50, 200, 60, 170], options3d: { enabled: true, alpha: 15, beta: 15, depth: 50, viewDistance: 25}} series = [ ['Firefox', 45.0], ['IE', 26.8], { :name=> 'Chrome', :y=> 12.8, :sliced=> true, :selected=> true }, ['Safari', 8.5], ['Opera', 6.2], ['Others', 0.7] ] plot_options = { pie: { allowPointSelect: true, cursor: 'pointer', depth: 40, dataLabels: { enabled: true, format: '{point.name}' } } } plt_pie_3d = Daru::View::Plot.new series, type: :pie, name: 'Browser share', chart: chart_options, plotOptions: plot_options plt_pie_3d.show_in_iruby