gruff 0.4.0-java
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/.travis.yml +14 -0
- data/Gemfile +10 -0
- data/History.txt +193 -0
- data/MIT-LICENSE +22 -0
- data/Manifest.txt +81 -0
- data/README.md +139 -0
- data/RELEASE.md +92 -0
- data/Rakefile +218 -0
- data/assets/bubble.png +0 -0
- data/assets/city_scene/background/0000.png +0 -0
- data/assets/city_scene/background/0600.png +0 -0
- data/assets/city_scene/background/2000.png +0 -0
- data/assets/city_scene/clouds/cloudy.png +0 -0
- data/assets/city_scene/clouds/partly_cloudy.png +0 -0
- data/assets/city_scene/clouds/stormy.png +0 -0
- data/assets/city_scene/grass/default.png +0 -0
- data/assets/city_scene/haze/true.png +0 -0
- data/assets/city_scene/number_sample/1.png +0 -0
- data/assets/city_scene/number_sample/2.png +0 -0
- data/assets/city_scene/number_sample/default.png +0 -0
- data/assets/city_scene/sky/0000.png +0 -0
- data/assets/city_scene/sky/0200.png +0 -0
- data/assets/city_scene/sky/0400.png +0 -0
- data/assets/city_scene/sky/0600.png +0 -0
- data/assets/city_scene/sky/0800.png +0 -0
- data/assets/city_scene/sky/1000.png +0 -0
- data/assets/city_scene/sky/1200.png +0 -0
- data/assets/city_scene/sky/1400.png +0 -0
- data/assets/city_scene/sky/1500.png +0 -0
- data/assets/city_scene/sky/1700.png +0 -0
- data/assets/city_scene/sky/2000.png +0 -0
- data/assets/pc306715.jpg +0 -0
- data/assets/plastik/blue.png +0 -0
- data/assets/plastik/green.png +0 -0
- data/assets/plastik/red.png +0 -0
- data/gruff.gemspec +36 -0
- data/init.rb +2 -0
- data/lib/gruff.rb +32 -0
- data/lib/gruff/accumulator_bar.rb +18 -0
- data/lib/gruff/area.rb +51 -0
- data/lib/gruff/bar.rb +108 -0
- data/lib/gruff/bar_conversion.rb +46 -0
- data/lib/gruff/base.rb +1169 -0
- data/lib/gruff/bezier.rb +46 -0
- data/lib/gruff/bullet.rb +111 -0
- data/lib/gruff/deprecated.rb +39 -0
- data/lib/gruff/dot.rb +125 -0
- data/lib/gruff/line.rb +242 -0
- data/lib/gruff/mini/bar.rb +37 -0
- data/lib/gruff/mini/legend.rb +109 -0
- data/lib/gruff/mini/pie.rb +36 -0
- data/lib/gruff/mini/side_bar.rb +35 -0
- data/lib/gruff/net.rb +138 -0
- data/lib/gruff/photo_bar.rb +100 -0
- data/lib/gruff/pie.rb +124 -0
- data/lib/gruff/scatter.rb +264 -0
- data/lib/gruff/scene.rb +209 -0
- data/lib/gruff/side_bar.rb +138 -0
- data/lib/gruff/side_stacked_bar.rb +97 -0
- data/lib/gruff/spider.rb +131 -0
- data/lib/gruff/stacked_area.rb +67 -0
- data/lib/gruff/stacked_bar.rb +57 -0
- data/lib/gruff/stacked_mixin.rb +23 -0
- data/lib/gruff/themes.rb +102 -0
- data/lib/gruff/version.rb +3 -0
- data/rails_generators/gruff/gruff_generator.rb +63 -0
- data/rails_generators/gruff/templates/controller.rb +32 -0
- data/rails_generators/gruff/templates/functional_test.rb +24 -0
- data/test/gruff_test_case.rb +155 -0
- data/test/image_compare.rb +58 -0
- data/test/output/accum_bar.png +0 -0
- data/test/output/area_keynote.png +0 -0
- data/test/output/area_keynote_small.png +0 -0
- data/test/output/area_many.png +0 -0
- data/test/output/area_many_areas_small.png +0 -0
- data/test/output/area_tiny.png +0 -0
- data/test/output/area_wide.png +0 -0
- data/test/output/bar2_wrapped_legend_16_400.png +0 -0
- data/test/output/bar2_wrapped_legend_16_800.png +0 -0
- data/test/output/bar2_wrapped_legend_30_400.png +0 -0
- data/test/output/bar2_wrapped_legend_30_800.png +0 -0
- data/test/output/bar2_wrapped_legend_4_400.png +0 -0
- data/test/output/bar2_wrapped_legend_4_800.png +0 -0
- data/test/output/bar2_wrapped_legend__400.png +0 -0
- data/test/output/bar2_wrapped_legend__800.png +0 -0
- data/test/output/bar_background_gradient_bottom_top.png +0 -0
- data/test/output/bar_background_gradient_left_right.png +0 -0
- data/test/output/bar_background_gradient_right_left.png +0 -0
- data/test/output/bar_background_gradient_top_bottom.png +0 -0
- data/test/output/bar_background_gradient_topleft_bottomright.png +0 -0
- data/test/output/bar_background_gradient_topright_bottomleft.png +0 -0
- data/test/output/bar_formatted_numbers.png +0 -0
- data/test/output/bar_keynote.png +0 -0
- data/test/output/bar_keynote_small.png +0 -0
- data/test/output/bar_long_legend_text.png +0 -0
- data/test/output/bar_manual_colors.png +0 -0
- data/test/output/bar_marker_shadow.png +0 -0
- data/test/output/bar_nearly_zero_max_10.png +0 -0
- data/test/output/bar_no_legend.png +0 -0
- data/test/output/bar_no_line_markers.png +0 -0
- data/test/output/bar_no_title.png +0 -0
- data/test/output/bar_no_title_or_legend.png +0 -0
- data/test/output/bar_odeo.png +0 -0
- data/test/output/bar_one_value.png +0 -0
- data/test/output/bar_pos_neg.png +0 -0
- data/test/output/bar_rails_keynote.png +0 -0
- data/test/output/bar_set_absolute_trunc.png +0 -0
- data/test/output/bar_set_label_stagger_height.png +0 -0
- data/test/output/bar_set_legend_box_size_lg.png +0 -0
- data/test/output/bar_set_legend_box_size_sm.png +0 -0
- data/test/output/bar_set_marker.png +0 -0
- data/test/output/bar_set_trailing_dots_trunc.png +0 -0
- data/test/output/bar_spacing_full.png +0 -0
- data/test/output/bar_spacing_half.png +0 -0
- data/test/output/bar_spacing_none.png +0 -0
- data/test/output/bar_tall_graph.png +0 -0
- data/test/output/bar_tall_graph_small.png +0 -0
- data/test/output/bar_themed.png +0 -0
- data/test/output/bar_title_margin.png +0 -0
- data/test/output/bar_value_labels.png +0 -0
- data/test/output/bar_wide_graph.png +0 -0
- data/test/output/bar_wide_graph_small.png +0 -0
- data/test/output/bar_wrapped_legend_16_400.png +0 -0
- data/test/output/bar_wrapped_legend_16_800.png +0 -0
- data/test/output/bar_wrapped_legend_30_400.png +0 -0
- data/test/output/bar_wrapped_legend_30_800.png +0 -0
- data/test/output/bar_wrapped_legend_4_400.png +0 -0
- data/test/output/bar_wrapped_legend_4_800.png +0 -0
- data/test/output/bar_wrapped_legend__400.png +0 -0
- data/test/output/bar_wrapped_legend__800.png +0 -0
- data/test/output/bar_x_y_labels.png +0 -0
- data/test/output/bar_y_increment_1.png +0 -0
- data/test/output/bar_y_increment_2.0.png +0 -0
- data/test/output/bar_y_increment_20.png +0 -0
- data/test/output/bar_y_increment_5.png +0 -0
- data/test/output/bar_zero_marker_count.png +0 -0
- data/test/output/bar_zero_spacing.png +0 -0
- data/test/output/bezier.png +0 -0
- data/test/output/bezier_2.png +0 -0
- data/test/output/bezier_3.png +0 -0
- data/test/output/bullet_greyscale.png +0 -0
- data/test/output/bullet_no_options.png +0 -0
- data/test/output/dot.png +0 -0
- data/test/output/dot_manual_colors.png +0 -0
- data/test/output/dot_nearly_zero_max_10.png +0 -0
- data/test/output/dot_no_legend.png +0 -0
- data/test/output/dot_no_line_markers.png +0 -0
- data/test/output/dot_no_title.png +0 -0
- data/test/output/dot_no_title_or_legend.png +0 -0
- data/test/output/dot_one_value.png +0 -0
- data/test/output/dot_pos_neg.png +0 -0
- data/test/output/dot_set_legend_box_size_lg.png +0 -0
- data/test/output/dot_set_legend_box_size_sm.png +0 -0
- data/test/output/dot_set_marker.png +0 -0
- data/test/output/dot_small.png +0 -0
- data/test/output/dot_tall_graph.png +0 -0
- data/test/output/dot_tall_graph_small.png +0 -0
- data/test/output/dot_themed.png +0 -0
- data/test/output/dot_wide_graph.png +0 -0
- data/test/output/dot_wide_graph_small.png +0 -0
- data/test/output/dot_x_y_labels.png +0 -0
- data/test/output/dot_y_increment_1.png +0 -0
- data/test/output/dot_y_increment_2.0.png +0 -0
- data/test/output/dot_y_increment_20.png +0 -0
- data/test/output/dot_y_increment_5.png +0 -0
- data/test/output/enhancements-1.png +0 -0
- data/test/output/enhancements.png +0 -0
- data/test/output/line_all_neg.png +0 -0
- data/test/output/line_all_neg_400.png +0 -0
- data/test/output/line_all_neg_no_max.png +0 -0
- data/test/output/line_baseline.png +0 -0
- data/test/output/line_hang_value.png +0 -0
- data/test/output/line_hide_dots.png +0 -0
- data/test/output/line_hide_lines.png +0 -0
- data/test/output/line_jruby_error.png +0 -0
- data/test/output/line_large.png +0 -0
- data/test/output/line_large_baseline.png +0 -0
- data/test/output/line_legend_at_bottom.png +0 -0
- data/test/output/line_many.png +0 -0
- data/test/output/line_many_lines_small.png +0 -0
- data/test/output/line_many_numbers.png +0 -0
- data/test/output/line_marker_label_accuracy.png +0 -0
- data/test/output/line_more_sets_than_colors.png +0 -0
- data/test/output/line_no_data.png +0 -0
- data/test/output/line_no_data_msg.png +0 -0
- data/test/output/line_no_data_other.png +0 -0
- data/test/output/line_no_hide.png +0 -0
- data/test/output/line_no_legend.png +0 -0
- data/test/output/line_no_line_markers.png +0 -0
- data/test/output/line_no_title.png +0 -0
- data/test/output/line_nothing_but_the_graph.png +0 -0
- data/test/output/line_one_value.png +0 -0
- data/test/output/line_one_value_array.png +0 -0
- data/test/output/line_pos_neg.png +0 -0
- data/test/output/line_pos_neg_400.png +0 -0
- data/test/output/line_similar_high_end_values.png +0 -0
- data/test/output/line_similar_high_end_values_with_floor.png +0 -0
- data/test/output/line_small_small_zero.png +0 -0
- data/test/output/line_small_values.png +0 -0
- data/test/output/line_small_values_small.png +0 -0
- data/test/output/line_small_zero.png +0 -0
- data/test/output/line_some_nil_points.png +0 -0
- data/test/output/line_theme_37signals_.png +0 -0
- data/test/output/line_theme_37signals_400.png +0 -0
- data/test/output/line_theme_keynote_.png +0 -0
- data/test/output/line_theme_keynote_400.png +0 -0
- data/test/output/line_theme_odeo_.png +0 -0
- data/test/output/line_theme_odeo_400.png +0 -0
- data/test/output/line_theme_rails_keynote_.png +0 -0
- data/test/output/line_theme_rails_keynote_400.png +0 -0
- data/test/output/line_tiny.png +0 -0
- data/test/output/line_transparent.png +0 -0
- data/test/output/line_very_small.png +0 -0
- data/test/output/line_wide_graph.png +0 -0
- data/test/output/line_wide_graph_small.png +0 -0
- data/test/output/line_xy.png +0 -0
- data/test/output/line_xy_pairs.png +0 -0
- data/test/output/line_y_axis_increment.png +0 -0
- data/test/output/mini_bar.png +0 -0
- data/test/output/mini_pie.png +0 -0
- data/test/output/mini_pie_right_legend.png +0 -0
- data/test/output/mini_side_bar.png +0 -0
- data/test/output/mini_side_bar_multi_color.png +0 -0
- data/test/output/net_dots_tiny.png +0 -0
- data/test/output/net_large.png +0 -0
- data/test/output/net_many.png +0 -0
- data/test/output/net_many_nets_small.png +0 -0
- data/test/output/net_no_data.png +0 -0
- data/test/output/net_no_data_msg.png +0 -0
- data/test/output/net_no_data_other.png +0 -0
- data/test/output/net_no_legend.png +0 -0
- data/test/output/net_no_net_markers.png +0 -0
- data/test/output/net_no_title.png +0 -0
- data/test/output/net_nothing_but_the_graph.png +0 -0
- data/test/output/net_similar_high_end_values.png +0 -0
- data/test/output/net_small.png +0 -0
- data/test/output/net_small_small.png +0 -0
- data/test/output/net_small_small_zero.png +0 -0
- data/test/output/net_small_zero.png +0 -0
- data/test/output/net_wide_graph.png +0 -0
- data/test/output/net_wide_graph_small.png +0 -0
- data/test/output/pie_equal.png +0 -0
- data/test/output/pie_grey.png +0 -0
- data/test/output/pie_keynote.png +0 -0
- data/test/output/pie_keynote_small.png +0 -0
- data/test/output/pie_legend.png +0 -0
- data/test/output/pie_legend_small.png +0 -0
- data/test/output/pie_nearly_equal.png +0 -0
- data/test/output/pie_one_val.png +0 -0
- data/test/output/pie_pastel.png +0 -0
- data/test/output/pie_simple.png +0 -0
- data/test/output/pie_wide.png +0 -0
- data/test/output/pie_wrapped_legend_16_400.png +0 -0
- data/test/output/pie_wrapped_legend_16_800.png +0 -0
- data/test/output/pie_wrapped_legend_30_400.png +0 -0
- data/test/output/pie_wrapped_legend_30_800.png +0 -0
- data/test/output/pie_wrapped_legend_4_400.png +0 -0
- data/test/output/pie_wrapped_legend_4_800.png +0 -0
- data/test/output/pie_wrapped_legend__400.png +0 -0
- data/test/output/pie_wrapped_legend__800.png +0 -0
- data/test/output/pie_zero.png +0 -0
- data/test/output/scatter_all_neg.png +0 -0
- data/test/output/scatter_all_neg_400.png +0 -0
- data/test/output/scatter_basic.png +0 -0
- data/test/output/scatter_many.png +0 -0
- data/test/output/scatter_no_data.png +0 -0
- data/test/output/scatter_no_data_msg.png +0 -0
- data/test/output/scatter_no_data_other.png +0 -0
- data/test/output/scatter_no_hide.png +0 -0
- data/test/output/scatter_no_labels.png +0 -0
- data/test/output/scatter_no_legend.png +0 -0
- data/test/output/scatter_no_line_markers.png +0 -0
- data/test/output/scatter_no_title.png +0 -0
- data/test/output/scatter_nothing_but_the_graph.png +0 -0
- data/test/output/scatter_pos_neg.png +0 -0
- data/test/output/scatter_pos_neg_400.png +0 -0
- data/test/output/scatter_wide_graph.png +0 -0
- data/test/output/scatter_wide_graph_small.png +0 -0
- data/test/output/scene_hazy_night.png +0 -0
- data/test/output/scene_not_hazy_day.png +0 -0
- data/test/output/scene_partly_cloudy_day.png +0 -0
- data/test/output/scene_stormy_day.png +0 -0
- data/test/output/scene_stormy_night.png +0 -0
- data/test/output/side_bar.png +0 -0
- data/test/output/side_bar_data_range.png +0 -0
- data/test/output/side_bar_labels.png +0 -0
- data/test/output/side_bar_spacing_full.png +0 -0
- data/test/output/side_bar_spacing_half.png +0 -0
- data/test/output/side_bar_spacing_none.png +0 -0
- data/test/output/side_stacked_bar_keynote.png +0 -0
- data/test/output/side_stacked_bar_keynote_small.png +0 -0
- data/test/output/side_stacked_bar_labels.png +0 -0
- data/test/output/side_stacked_bar_long_label.png +0 -0
- data/test/output/side_stacked_bar_wide.png +0 -0
- data/test/output/spider_37signals.png +0 -0
- data/test/output/spider_equal.png +0 -0
- data/test/output/spider_keynote.png +0 -0
- data/test/output/spider_legend.png +0 -0
- data/test/output/spider_legend_small.png +0 -0
- data/test/output/spider_lots_of_data.png +0 -0
- data/test/output/spider_lots_of_data_normal_names.png +0 -0
- data/test/output/spider_nearly_equal.png +0 -0
- data/test/output/spider_no_axes.png +0 -0
- data/test/output/spider_no_background.png +0 -0
- data/test/output/spider_no_print.png +0 -0
- data/test/output/spider_overlay_1.png +0 -0
- data/test/output/spider_overlay_2.png +0 -0
- data/test/output/spider_rotation.png +0 -0
- data/test/output/spider_small.png +0 -0
- data/test/output/spider_wide.png +0 -0
- data/test/output/spider_zero.png +0 -0
- data/test/output/stacked_area_keynote.png +0 -0
- data/test/output/stacked_area_keynote_small.png +0 -0
- data/test/output/stacked_bar_keynote.png +0 -0
- data/test/output/stacked_bar_keynote_small.png +0 -0
- data/test/output_java/accum_bar.png +0 -0
- data/test/output_java/area_keynote.png +0 -0
- data/test/output_java/area_keynote_small.png +0 -0
- data/test/output_java/area_many.png +0 -0
- data/test/output_java/area_many_areas_small.png +0 -0
- data/test/output_java/area_tiny.png +0 -0
- data/test/output_java/area_wide.png +0 -0
- data/test/output_java/bar2_wrapped_legend_16_400.png +0 -0
- data/test/output_java/bar2_wrapped_legend_16_800.png +0 -0
- data/test/output_java/bar2_wrapped_legend_30_400.png +0 -0
- data/test/output_java/bar2_wrapped_legend_30_800.png +0 -0
- data/test/output_java/bar2_wrapped_legend_4_400.png +0 -0
- data/test/output_java/bar2_wrapped_legend_4_800.png +0 -0
- data/test/output_java/bar2_wrapped_legend__400.png +0 -0
- data/test/output_java/bar2_wrapped_legend__800.png +0 -0
- data/test/output_java/bar_background_gradient_bottom_top.png +0 -0
- data/test/output_java/bar_background_gradient_left_right.png +0 -0
- data/test/output_java/bar_background_gradient_right_left.png +0 -0
- data/test/output_java/bar_background_gradient_top_bottom.png +0 -0
- data/test/output_java/bar_background_gradient_topleft_bottomright.png +0 -0
- data/test/output_java/bar_background_gradient_topright_bottomleft.png +0 -0
- data/test/output_java/bar_formatted_numbers.png +0 -0
- data/test/output_java/bar_keynote.png +0 -0
- data/test/output_java/bar_keynote_small.png +0 -0
- data/test/output_java/bar_long_legend_text.png +0 -0
- data/test/output_java/bar_manual_colors.png +0 -0
- data/test/output_java/bar_marker_shadow.png +0 -0
- data/test/output_java/bar_nearly_zero_max_10.png +0 -0
- data/test/output_java/bar_no_legend.png +0 -0
- data/test/output_java/bar_no_line_markers.png +0 -0
- data/test/output_java/bar_no_title.png +0 -0
- data/test/output_java/bar_no_title_or_legend.png +0 -0
- data/test/output_java/bar_odeo.png +0 -0
- data/test/output_java/bar_one_value.png +0 -0
- data/test/output_java/bar_pos_neg.png +0 -0
- data/test/output_java/bar_rails_keynote.png +0 -0
- data/test/output_java/bar_set_absolute_trunc.png +0 -0
- data/test/output_java/bar_set_label_stagger_height.png +0 -0
- data/test/output_java/bar_set_legend_box_size_lg.png +0 -0
- data/test/output_java/bar_set_legend_box_size_sm.png +0 -0
- data/test/output_java/bar_set_marker.png +0 -0
- data/test/output_java/bar_set_trailing_dots_trunc.png +0 -0
- data/test/output_java/bar_spacing_full.png +0 -0
- data/test/output_java/bar_spacing_half.png +0 -0
- data/test/output_java/bar_spacing_none.png +0 -0
- data/test/output_java/bar_tall_graph.png +0 -0
- data/test/output_java/bar_tall_graph_small.png +0 -0
- data/test/output_java/bar_themed.png +0 -0
- data/test/output_java/bar_title_margin.png +0 -0
- data/test/output_java/bar_value_labels.png +0 -0
- data/test/output_java/bar_wide_graph.png +0 -0
- data/test/output_java/bar_wide_graph_small.png +0 -0
- data/test/output_java/bar_wrapped_legend_16_400.png +0 -0
- data/test/output_java/bar_wrapped_legend_16_800.png +0 -0
- data/test/output_java/bar_wrapped_legend_30_400.png +0 -0
- data/test/output_java/bar_wrapped_legend_30_800.png +0 -0
- data/test/output_java/bar_wrapped_legend_4_400.png +0 -0
- data/test/output_java/bar_wrapped_legend_4_800.png +0 -0
- data/test/output_java/bar_wrapped_legend__400.png +0 -0
- data/test/output_java/bar_wrapped_legend__800.png +0 -0
- data/test/output_java/bar_x_y_labels.png +0 -0
- data/test/output_java/bar_y_increment_1.png +0 -0
- data/test/output_java/bar_y_increment_2.0.png +0 -0
- data/test/output_java/bar_y_increment_20.png +0 -0
- data/test/output_java/bar_y_increment_5.png +0 -0
- data/test/output_java/bar_zero_marker_count.png +0 -0
- data/test/output_java/bar_zero_spacing.png +0 -0
- data/test/output_java/bezier.png +0 -0
- data/test/output_java/bezier_2.png +0 -0
- data/test/output_java/bezier_3.png +0 -0
- data/test/output_java/bullet_greyscale.png +0 -0
- data/test/output_java/bullet_no_options.png +0 -0
- data/test/output_java/dot.png +0 -0
- data/test/output_java/dot_manual_colors.png +0 -0
- data/test/output_java/dot_nearly_zero_max_10.png +0 -0
- data/test/output_java/dot_no_legend.png +0 -0
- data/test/output_java/dot_no_line_markers.png +0 -0
- data/test/output_java/dot_no_title.png +0 -0
- data/test/output_java/dot_no_title_or_legend.png +0 -0
- data/test/output_java/dot_one_value.png +0 -0
- data/test/output_java/dot_pos_neg.png +0 -0
- data/test/output_java/dot_set_legend_box_size_lg.png +0 -0
- data/test/output_java/dot_set_legend_box_size_sm.png +0 -0
- data/test/output_java/dot_set_marker.png +0 -0
- data/test/output_java/dot_small.png +0 -0
- data/test/output_java/dot_tall_graph.png +0 -0
- data/test/output_java/dot_tall_graph_small.png +0 -0
- data/test/output_java/dot_themed.png +0 -0
- data/test/output_java/dot_wide_graph.png +0 -0
- data/test/output_java/dot_wide_graph_small.png +0 -0
- data/test/output_java/dot_x_y_labels.png +0 -0
- data/test/output_java/dot_y_increment_1.png +0 -0
- data/test/output_java/dot_y_increment_2.0.png +0 -0
- data/test/output_java/dot_y_increment_20.png +0 -0
- data/test/output_java/dot_y_increment_5.png +0 -0
- data/test/output_java/enhancements-1.png +0 -0
- data/test/output_java/enhancements.png +0 -0
- data/test/output_java/line_all_neg.png +0 -0
- data/test/output_java/line_all_neg_400.png +0 -0
- data/test/output_java/line_all_neg_no_max.png +0 -0
- data/test/output_java/line_baseline.png +0 -0
- data/test/output_java/line_hang_value.png +0 -0
- data/test/output_java/line_hide_dots.png +0 -0
- data/test/output_java/line_hide_lines.png +0 -0
- data/test/output_java/line_jruby_error.png +0 -0
- data/test/output_java/line_large.png +0 -0
- data/test/output_java/line_large_baseline.png +0 -0
- data/test/output_java/line_legend_at_bottom.png +0 -0
- data/test/output_java/line_many.png +0 -0
- data/test/output_java/line_many_lines_small.png +0 -0
- data/test/output_java/line_many_numbers.png +0 -0
- data/test/output_java/line_marker_label_accuracy.png +0 -0
- data/test/output_java/line_more_sets_than_colors.png +0 -0
- data/test/output_java/line_no_data.png +0 -0
- data/test/output_java/line_no_data_msg.png +0 -0
- data/test/output_java/line_no_data_other.png +0 -0
- data/test/output_java/line_no_hide.png +0 -0
- data/test/output_java/line_no_legend.png +0 -0
- data/test/output_java/line_no_line_markers.png +0 -0
- data/test/output_java/line_no_title.png +0 -0
- data/test/output_java/line_nothing_but_the_graph.png +0 -0
- data/test/output_java/line_one_value.png +0 -0
- data/test/output_java/line_one_value_array.png +0 -0
- data/test/output_java/line_pos_neg.png +0 -0
- data/test/output_java/line_pos_neg_400.png +0 -0
- data/test/output_java/line_similar_high_end_values.png +0 -0
- data/test/output_java/line_similar_high_end_values_with_floor.png +0 -0
- data/test/output_java/line_small_small_zero.png +0 -0
- data/test/output_java/line_small_values.png +0 -0
- data/test/output_java/line_small_values_small.png +0 -0
- data/test/output_java/line_small_zero.png +0 -0
- data/test/output_java/line_some_nil_points.png +0 -0
- data/test/output_java/line_theme_37signals_.png +0 -0
- data/test/output_java/line_theme_37signals_400.png +0 -0
- data/test/output_java/line_theme_keynote_.png +0 -0
- data/test/output_java/line_theme_keynote_400.png +0 -0
- data/test/output_java/line_theme_odeo_.png +0 -0
- data/test/output_java/line_theme_odeo_400.png +0 -0
- data/test/output_java/line_theme_rails_keynote_.png +0 -0
- data/test/output_java/line_theme_rails_keynote_400.png +0 -0
- data/test/output_java/line_tiny.png +0 -0
- data/test/output_java/line_transparent.png +0 -0
- data/test/output_java/line_very_small.png +0 -0
- data/test/output_java/line_wide_graph.png +0 -0
- data/test/output_java/line_wide_graph_small.png +0 -0
- data/test/output_java/line_xy.png +0 -0
- data/test/output_java/line_xy_pairs.png +0 -0
- data/test/output_java/line_y_axis_increment.png +0 -0
- data/test/output_java/mini_bar.png +0 -0
- data/test/output_java/mini_pie.png +0 -0
- data/test/output_java/mini_pie_right_legend.png +0 -0
- data/test/output_java/mini_side_bar.png +0 -0
- data/test/output_java/mini_side_bar_multi_color.png +0 -0
- data/test/output_java/net_dots_tiny.png +0 -0
- data/test/output_java/net_large.png +0 -0
- data/test/output_java/net_many.png +0 -0
- data/test/output_java/net_many_nets_small.png +0 -0
- data/test/output_java/net_no_data.png +0 -0
- data/test/output_java/net_no_data_msg.png +0 -0
- data/test/output_java/net_no_data_other.png +0 -0
- data/test/output_java/net_no_legend.png +0 -0
- data/test/output_java/net_no_net_markers.png +0 -0
- data/test/output_java/net_no_title.png +0 -0
- data/test/output_java/net_nothing_but_the_graph.png +0 -0
- data/test/output_java/net_similar_high_end_values.png +0 -0
- data/test/output_java/net_small.png +0 -0
- data/test/output_java/net_small_small.png +0 -0
- data/test/output_java/net_small_small_zero.png +0 -0
- data/test/output_java/net_small_zero.png +0 -0
- data/test/output_java/net_wide_graph.png +0 -0
- data/test/output_java/net_wide_graph_small.png +0 -0
- data/test/output_java/pie_equal.png +0 -0
- data/test/output_java/pie_grey.png +0 -0
- data/test/output_java/pie_keynote.png +0 -0
- data/test/output_java/pie_keynote_small.png +0 -0
- data/test/output_java/pie_legend.png +0 -0
- data/test/output_java/pie_legend_small.png +0 -0
- data/test/output_java/pie_nearly_equal.png +0 -0
- data/test/output_java/pie_one_val.png +0 -0
- data/test/output_java/pie_pastel.png +0 -0
- data/test/output_java/pie_simple.png +0 -0
- data/test/output_java/pie_wide.png +0 -0
- data/test/output_java/pie_wrapped_legend_16_400.png +0 -0
- data/test/output_java/pie_wrapped_legend_16_800.png +0 -0
- data/test/output_java/pie_wrapped_legend_30_400.png +0 -0
- data/test/output_java/pie_wrapped_legend_30_800.png +0 -0
- data/test/output_java/pie_wrapped_legend_4_400.png +0 -0
- data/test/output_java/pie_wrapped_legend_4_800.png +0 -0
- data/test/output_java/pie_wrapped_legend__400.png +0 -0
- data/test/output_java/pie_wrapped_legend__800.png +0 -0
- data/test/output_java/pie_zero.png +0 -0
- data/test/output_java/scatter_all_neg.png +0 -0
- data/test/output_java/scatter_all_neg_400.png +0 -0
- data/test/output_java/scatter_basic.png +0 -0
- data/test/output_java/scatter_many.png +0 -0
- data/test/output_java/scatter_no_data.png +0 -0
- data/test/output_java/scatter_no_data_msg.png +0 -0
- data/test/output_java/scatter_no_data_other.png +0 -0
- data/test/output_java/scatter_no_hide.png +0 -0
- data/test/output_java/scatter_no_labels.png +0 -0
- data/test/output_java/scatter_no_legend.png +0 -0
- data/test/output_java/scatter_no_line_markers.png +0 -0
- data/test/output_java/scatter_no_title.png +0 -0
- data/test/output_java/scatter_nothing_but_the_graph.png +0 -0
- data/test/output_java/scatter_pos_neg.png +0 -0
- data/test/output_java/scatter_pos_neg_400.png +0 -0
- data/test/output_java/scatter_wide_graph.png +0 -0
- data/test/output_java/scatter_wide_graph_small.png +0 -0
- data/test/output_java/scene_hazy_night.png +0 -0
- data/test/output_java/scene_not_hazy_day.png +0 -0
- data/test/output_java/scene_partly_cloudy_day.png +0 -0
- data/test/output_java/scene_stormy_day.png +0 -0
- data/test/output_java/scene_stormy_night.png +0 -0
- data/test/output_java/side_bar.png +0 -0
- data/test/output_java/side_bar_data_range.png +0 -0
- data/test/output_java/side_bar_labels.png +0 -0
- data/test/output_java/side_bar_spacing_full.png +0 -0
- data/test/output_java/side_bar_spacing_half.png +0 -0
- data/test/output_java/side_bar_spacing_none.png +0 -0
- data/test/output_java/side_stacked_bar_keynote.png +0 -0
- data/test/output_java/side_stacked_bar_keynote_small.png +0 -0
- data/test/output_java/side_stacked_bar_labels.png +0 -0
- data/test/output_java/side_stacked_bar_long_label.png +0 -0
- data/test/output_java/side_stacked_bar_wide.png +0 -0
- data/test/output_java/spider_37signals.png +0 -0
- data/test/output_java/spider_equal.png +0 -0
- data/test/output_java/spider_keynote.png +0 -0
- data/test/output_java/spider_legend.png +0 -0
- data/test/output_java/spider_legend_small.png +0 -0
- data/test/output_java/spider_lots_of_data.png +0 -0
- data/test/output_java/spider_lots_of_data_normal_names.png +0 -0
- data/test/output_java/spider_nearly_equal.png +0 -0
- data/test/output_java/spider_no_axes.png +0 -0
- data/test/output_java/spider_no_background.png +0 -0
- data/test/output_java/spider_no_print.png +0 -0
- data/test/output_java/spider_overlay_1.png +0 -0
- data/test/output_java/spider_overlay_2.png +0 -0
- data/test/output_java/spider_rotation.png +0 -0
- data/test/output_java/spider_small.png +0 -0
- data/test/output_java/spider_wide.png +0 -0
- data/test/output_java/spider_zero.png +0 -0
- data/test/output_java/stacked_area_keynote.png +0 -0
- data/test/output_java/stacked_area_keynote_small.png +0 -0
- data/test/output_java/stacked_bar_keynote.png +0 -0
- data/test/output_java/stacked_bar_keynote_small.png +0 -0
- data/test/test_accumulator_bar.rb +51 -0
- data/test/test_area.rb +134 -0
- data/test/test_bar.rb +505 -0
- data/test/test_base.rb +8 -0
- data/test/test_bezier.rb +33 -0
- data/test/test_bullet.rb +26 -0
- data/test/test_dot.rb +263 -0
- data/test/test_legend.rb +68 -0
- data/test/test_line.rb +626 -0
- data/test/test_mini_bar.rb +33 -0
- data/test/test_mini_pie.rb +25 -0
- data/test/test_mini_side_bar.rb +36 -0
- data/test/test_net.rb +231 -0
- data/test/test_photo.rb +41 -0
- data/test/test_pie.rb +154 -0
- data/test/test_scatter.rb +233 -0
- data/test/test_scene.rb +100 -0
- data/test/test_side_bar.rb +56 -0
- data/test/test_sidestacked_bar.rb +105 -0
- data/test/test_spider.rb +226 -0
- data/test/test_stacked_area.rb +52 -0
- data/test/test_stacked_bar.rb +52 -0
- metadata +1176 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
|
2
|
+
require File.expand_path('../gruff_test_case', __FILE__)
|
3
|
+
|
4
|
+
class TestMiniBar < GruffTestCase
|
5
|
+
|
6
|
+
def test_simple_bar
|
7
|
+
setup_single_dataset
|
8
|
+
g = setup_basic_graph(Gruff::Mini::Bar, 200)
|
9
|
+
g.hide_mini_legend = true
|
10
|
+
write_test_file g, 'mini_bar.png'
|
11
|
+
end
|
12
|
+
|
13
|
+
# def test_simple_bar_wide_dataset
|
14
|
+
# setup_wide_dataset
|
15
|
+
# g = setup_basic_graph(Gruff::Mini::Bar, 200)
|
16
|
+
# write_test_file g, 'mini_bar_wide_data.png'
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# def test_code_sample
|
20
|
+
# g = Gruff::Mini::Bar.new(200)
|
21
|
+
# g.data "Jim", [200, 500, 400]
|
22
|
+
# g.labels = { 0 => 'This Month', 1 => 'Average', 2 => 'Overall'}
|
23
|
+
# g.write "mini_bar_one_color.png"
|
24
|
+
#
|
25
|
+
# g = Gruff::Mini::Bar.new(200)
|
26
|
+
# g.data "Car", 200
|
27
|
+
# g.data "Food", 500
|
28
|
+
# g.data "Art", 1000
|
29
|
+
# g.data "Music", 16
|
30
|
+
# g.write "mini_bar_many_colors.png"
|
31
|
+
# end
|
32
|
+
|
33
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require File.expand_path('../gruff_test_case', __FILE__)
|
2
|
+
|
3
|
+
class TestMiniPie < GruffTestCase
|
4
|
+
|
5
|
+
def test_simple_pie
|
6
|
+
g = setup_basic_graph(Gruff::Mini::Pie, 200)
|
7
|
+
write_test_file g, 'mini_pie.png'
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_pie_with_legend_right
|
11
|
+
g = setup_basic_graph(Gruff::Mini::Pie, 200)
|
12
|
+
g.legend_position = :right
|
13
|
+
write_test_file g, 'mini_pie_right_legend.png'
|
14
|
+
end
|
15
|
+
|
16
|
+
# def test_code_sample
|
17
|
+
# g = Gruff::Mini::Pie.new(200)
|
18
|
+
# g.data "Car", 200
|
19
|
+
# g.data "Food", 500
|
20
|
+
# g.data "Art", 1000
|
21
|
+
# g.data "Music", 16
|
22
|
+
# g.write "mini_pie.png"
|
23
|
+
# end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.expand_path('../gruff_test_case', __FILE__)
|
2
|
+
|
3
|
+
class TestMiniSideBar < GruffTestCase
|
4
|
+
|
5
|
+
def test_one_color
|
6
|
+
# Use a single data set
|
7
|
+
@datasets = [
|
8
|
+
[:Jimmy, [25, 36, 86, 39]]
|
9
|
+
]
|
10
|
+
@labels = {
|
11
|
+
0 => 'Auto',
|
12
|
+
1 => 'Entertainment',
|
13
|
+
2 => 'Food',
|
14
|
+
3 => 'Bus'
|
15
|
+
}
|
16
|
+
|
17
|
+
g = setup_basic_graph(Gruff::Mini::SideBar, 200)
|
18
|
+
write_test_file g, 'mini_side_bar.png'
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_multi_color
|
22
|
+
# @datasets = [
|
23
|
+
# [:Jimmy, [25, 36, 86, 39]]
|
24
|
+
# ]
|
25
|
+
# @labels = {
|
26
|
+
# 0 => 'Auto',
|
27
|
+
# 1 => 'Entertainment',
|
28
|
+
# 2 => 'Food',
|
29
|
+
# 3 => 'Bus'
|
30
|
+
# }
|
31
|
+
|
32
|
+
g = setup_basic_graph(Gruff::Mini::SideBar, 200)
|
33
|
+
write_test_file g, 'mini_side_bar_multi_color.png'
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
data/test/test_net.rb
ADDED
@@ -0,0 +1,231 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + "/gruff_test_case"
|
4
|
+
|
5
|
+
class TestGruffNet < GruffTestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
super
|
9
|
+
@datasets = [
|
10
|
+
[:Jimmy, [25, 36, 86, 39, 25, 31, 79, 88]],
|
11
|
+
[:Charles, [80, 54, 67, 54, 68, 70, 90, 95]],
|
12
|
+
[:Julie, [22, 29, 35, 38, 36, 40, 46, 57]],
|
13
|
+
[:Jane, [95, 95, 95, 90, 85, 80, 88, 100]],
|
14
|
+
[:Philip, [90, 34, 23, 12, 78, 89, 98, 88]],
|
15
|
+
["Arthur", [5, 10, 13, 11, 6, 16, 22, 32]],
|
16
|
+
]
|
17
|
+
|
18
|
+
@sample_labels = {
|
19
|
+
0 => '5/6',
|
20
|
+
1 => '5/15',
|
21
|
+
2 => '5/24',
|
22
|
+
3 => '5/30',
|
23
|
+
4 => '6/4',
|
24
|
+
5 => '6/12',
|
25
|
+
6 => '6/21',
|
26
|
+
7 => '6/28',
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_net_small_values
|
31
|
+
@datasets = [
|
32
|
+
[:small, [0.1, 0.14356, 0.0, 0.5674839, 0.456]],
|
33
|
+
[:small2, [0.2, 0.3, 0.1, 0.05, 0.9]]
|
34
|
+
]
|
35
|
+
|
36
|
+
g = Gruff::Net.new
|
37
|
+
g.title = "Small Values Net Graph Test"
|
38
|
+
@datasets.each do |data|
|
39
|
+
g.data(data[0], data[1])
|
40
|
+
end
|
41
|
+
g.write("test/output/net_small.png")
|
42
|
+
|
43
|
+
g = Gruff::Net.new(400)
|
44
|
+
g.title = "Small Values Net Graph Test 400px"
|
45
|
+
@datasets.each do |data|
|
46
|
+
g.data(data[0], data[1])
|
47
|
+
end
|
48
|
+
g.write("test/output/net_small_small.png")
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_net_starts_with_zero
|
52
|
+
@datasets = [
|
53
|
+
[:first0, [0, 5, 10, 8, 18]],
|
54
|
+
[:normal, [1, 2, 3, 4, 5]]
|
55
|
+
]
|
56
|
+
|
57
|
+
g = Gruff::Net.new
|
58
|
+
g.title = "Small Values Net Graph Test"
|
59
|
+
@datasets.each do |data|
|
60
|
+
g.data(data[0], data[1])
|
61
|
+
end
|
62
|
+
g.write("test/output/net_small_zero.png")
|
63
|
+
|
64
|
+
g = Gruff::Net.new(400)
|
65
|
+
g.title = "Small Values Net Graph Test 400px"
|
66
|
+
@datasets.each do |data|
|
67
|
+
g.data(data[0], data[1])
|
68
|
+
end
|
69
|
+
g.write("test/output/net_small_small_zero.png")
|
70
|
+
end
|
71
|
+
|
72
|
+
|
73
|
+
def test_net_large_values
|
74
|
+
@datasets = [
|
75
|
+
[:large, [100_005, 35_000, 28_000, 27_000]],
|
76
|
+
[:large2, [35_000, 28_000, 27_000, 100_005]],
|
77
|
+
[:large3, [28_000, 27_000, 100_005, 35_000]],
|
78
|
+
[:large4, [1_238, 39_092, 27_938, 48_876]]
|
79
|
+
]
|
80
|
+
|
81
|
+
g = Gruff::Net.new
|
82
|
+
g.title = "Very Large Values Net Graph Test"
|
83
|
+
@datasets.each do |data|
|
84
|
+
g.data(data[0], data[1])
|
85
|
+
end
|
86
|
+
|
87
|
+
g.write("test/output/net_large.png")
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_many_datapoints
|
91
|
+
g = Gruff::Net.new
|
92
|
+
g.title = "Many Multi-Net Graph Test"
|
93
|
+
g.labels = {
|
94
|
+
0 => 'June',
|
95
|
+
10 => 'July',
|
96
|
+
30 => 'August',
|
97
|
+
50 => 'September',
|
98
|
+
}
|
99
|
+
g.data('many points', (0..50).collect {|i| rand(100) })
|
100
|
+
|
101
|
+
# Default theme
|
102
|
+
g.write("test/output/net_many.png")
|
103
|
+
end
|
104
|
+
|
105
|
+
|
106
|
+
def test_similar_high_end_values
|
107
|
+
g = Gruff::Net.new
|
108
|
+
g.title = "Similar High End Values Test"
|
109
|
+
g.data('similar points', %w(29.43 29.459 29.498 29.53 29.548 29.589 29.619 29.66 29.689 29.849 29.878 29.74 29.769 29.79 29.808 29.828).collect {|i| i.to_f} )
|
110
|
+
|
111
|
+
# Default theme
|
112
|
+
g.write("test/output/net_similar_high_end_values.png")
|
113
|
+
end
|
114
|
+
|
115
|
+
def test_many_nets_graph_small
|
116
|
+
g = Gruff::Net.new(400)
|
117
|
+
g.title = "Many Values Net Test 400px"
|
118
|
+
g.labels = {
|
119
|
+
0 => '5/6',
|
120
|
+
10 => '5/15',
|
121
|
+
20 => '5/24',
|
122
|
+
30 => '5/30',
|
123
|
+
40 => '6/4',
|
124
|
+
50 => '6/16'
|
125
|
+
}
|
126
|
+
%w{jimmy jane philip arthur julie bert}.each do |student_name|
|
127
|
+
g.data(student_name, (0..50).collect { |i| rand 100 })
|
128
|
+
end
|
129
|
+
|
130
|
+
# Default theme
|
131
|
+
g.write("test/output/net_many_nets_small.png")
|
132
|
+
end
|
133
|
+
|
134
|
+
def test_dots_graph_tiny
|
135
|
+
g = Gruff::Net.new(300)
|
136
|
+
g.title = "Dots Test 300px"
|
137
|
+
g.labels = {
|
138
|
+
0 => '5/6',
|
139
|
+
10 => '5/15',
|
140
|
+
20 => '5/24',
|
141
|
+
30 => '5/30',
|
142
|
+
40 => '6/4',
|
143
|
+
50 => '6/16'
|
144
|
+
}
|
145
|
+
%w{jimmy jane philip arthur julie bert}.each do |student_name|
|
146
|
+
g.data(student_name, (0..50).collect { |i| rand 100 })
|
147
|
+
end
|
148
|
+
|
149
|
+
# Default theme
|
150
|
+
g.write("test/output/net_dots_tiny.png")
|
151
|
+
end
|
152
|
+
|
153
|
+
def test_no_data
|
154
|
+
g = Gruff::Net.new(400)
|
155
|
+
g.title = "No Data"
|
156
|
+
# Default theme
|
157
|
+
g.write("test/output/net_no_data.png")
|
158
|
+
|
159
|
+
g = Gruff::Net.new(400)
|
160
|
+
g.title = "No Data Title"
|
161
|
+
g.no_data_message = 'There is no data'
|
162
|
+
g.write("test/output/net_no_data_msg.png")
|
163
|
+
end
|
164
|
+
|
165
|
+
|
166
|
+
def test_all_zeros
|
167
|
+
g = Gruff::Net.new(400)
|
168
|
+
g.title = "All Zeros"
|
169
|
+
|
170
|
+
g.data(:gus, [0,0,0,0])
|
171
|
+
|
172
|
+
# Default theme
|
173
|
+
g.write("test/output/net_no_data_other.png")
|
174
|
+
end
|
175
|
+
|
176
|
+
def test_no_title
|
177
|
+
g = Gruff::Net.new(400)
|
178
|
+
g.labels = @sample_labels
|
179
|
+
@datasets.each do |data|
|
180
|
+
g.data(data[0], data[1])
|
181
|
+
end
|
182
|
+
|
183
|
+
g.write("test/output/net_no_title.png")
|
184
|
+
end
|
185
|
+
|
186
|
+
def test_no_net_markers
|
187
|
+
g = setup_basic_graph(400)
|
188
|
+
g.title = "No Net Markers"
|
189
|
+
g.hide_line_markers = true
|
190
|
+
g.write("test/output/net_no_net_markers.png")
|
191
|
+
end
|
192
|
+
|
193
|
+
def test_no_legend
|
194
|
+
g = setup_basic_graph(400)
|
195
|
+
g.title = "No Legend"
|
196
|
+
g.hide_legend = true
|
197
|
+
g.write("test/output/net_no_legend.png")
|
198
|
+
end
|
199
|
+
|
200
|
+
def test_nothing_but_the_graph
|
201
|
+
g = setup_basic_graph(400)
|
202
|
+
g.title = "THIS TITLE SHOULD NOT DISPLAY!!!"
|
203
|
+
g.hide_line_markers = true
|
204
|
+
g.hide_legend = true
|
205
|
+
g.hide_title = true
|
206
|
+
g.write("test/output/net_nothing_but_the_graph.png")
|
207
|
+
end
|
208
|
+
|
209
|
+
def test_wide_graph
|
210
|
+
g = setup_basic_graph('800x400')
|
211
|
+
g.title = "Wide Graph"
|
212
|
+
g.write("test/output/net_wide_graph.png")
|
213
|
+
|
214
|
+
g = setup_basic_graph('400x200')
|
215
|
+
g.title = "Wide Graph Small"
|
216
|
+
g.write("test/output/net_wide_graph_small.png")
|
217
|
+
end
|
218
|
+
|
219
|
+
protected
|
220
|
+
|
221
|
+
def setup_basic_graph(size=800)
|
222
|
+
g = Gruff::Net.new(size)
|
223
|
+
g.title = "My Graph Title"
|
224
|
+
g.labels = @sample_labels
|
225
|
+
@datasets.each do |data|
|
226
|
+
g.data(data[0], data[1])
|
227
|
+
end
|
228
|
+
return g
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|
data/test/test_photo.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + "/gruff_test_case"
|
4
|
+
|
5
|
+
class TestGruffPhotoBar < GruffTestCase
|
6
|
+
|
7
|
+
# def setup
|
8
|
+
# @datasets = [
|
9
|
+
# [:Jimmy, [25, 36, 86, 39]],
|
10
|
+
# [:Charles, [80, 54, 67, 54]],
|
11
|
+
# # [:Charity, [0, nil, 100, 90]],
|
12
|
+
# ]
|
13
|
+
# end
|
14
|
+
#
|
15
|
+
# def test_bar_graph
|
16
|
+
# bar_graph_sized
|
17
|
+
# bar_graph_sized(400)
|
18
|
+
# end
|
19
|
+
#
|
20
|
+
#
|
21
|
+
# protected
|
22
|
+
#
|
23
|
+
# def bar_graph_sized(size=800)
|
24
|
+
# g = Gruff::PhotoBar.new(size)
|
25
|
+
# g.title = "Photo Bar Graph Test #{size}px"
|
26
|
+
# g.labels = {
|
27
|
+
# 0 => '5/6',
|
28
|
+
# 1 => '5/15',
|
29
|
+
# 2 => '5/24',
|
30
|
+
# 3 => '5/30',
|
31
|
+
# }
|
32
|
+
# @datasets.each do |data|
|
33
|
+
# g.data(*data)
|
34
|
+
# end
|
35
|
+
#
|
36
|
+
# g.theme = 'plastik'
|
37
|
+
#
|
38
|
+
# g.write("test/output/photo_plastik_#{size}.png")
|
39
|
+
# end
|
40
|
+
|
41
|
+
end
|
data/test/test_pie.rb
ADDED
@@ -0,0 +1,154 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + "/gruff_test_case"
|
4
|
+
|
5
|
+
class TestGruffPie < GruffTestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
@datasets = [
|
9
|
+
[:Darren, [25]],
|
10
|
+
[:Chris, [80]],
|
11
|
+
[:Egbert, [22]],
|
12
|
+
[:Adam, [95]],
|
13
|
+
[:Bill, [90]],
|
14
|
+
["Frank", [5]],
|
15
|
+
["Zero", [0]],
|
16
|
+
]
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_pie_graph
|
20
|
+
g = Gruff::Pie.new
|
21
|
+
g.title = "Visual Pie Graph Test"
|
22
|
+
@datasets.each do |data|
|
23
|
+
g.data(data[0], data[1])
|
24
|
+
end
|
25
|
+
|
26
|
+
# Default theme
|
27
|
+
g.write("test/output/pie_keynote.png")
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_pie_graph_greyscale
|
31
|
+
g = Gruff::Pie.new
|
32
|
+
g.title = "Greyscale Pie Graph Test"
|
33
|
+
g.theme = Gruff::Themes::GREYSCALE
|
34
|
+
@datasets.each do |data|
|
35
|
+
g.data(data[0], data[1])
|
36
|
+
end
|
37
|
+
|
38
|
+
# Default theme
|
39
|
+
g.write("test/output/pie_grey.png")
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_pie_graph_pastel
|
43
|
+
g = Gruff::Pie.new
|
44
|
+
g.theme = Gruff::Themes::PASTEL
|
45
|
+
g.title = "Pastel Pie Graph Test"
|
46
|
+
@datasets.each do |data|
|
47
|
+
g.data(data[0], data[1])
|
48
|
+
end
|
49
|
+
|
50
|
+
# Default theme
|
51
|
+
g.write("test/output/pie_pastel.png")
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
def test_pie_graph_small
|
56
|
+
g = Gruff::Pie.new(400)
|
57
|
+
g.title = "Visual Pie Graph Test Small"
|
58
|
+
@datasets.each do |data|
|
59
|
+
g.data(data[0], data[1])
|
60
|
+
end
|
61
|
+
|
62
|
+
# Default theme
|
63
|
+
g.write("test/output/pie_keynote_small.png")
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_pie_graph_nearly_equal
|
67
|
+
g = Gruff::Pie.new
|
68
|
+
g.title = "Pie Graph Nearly Equal"
|
69
|
+
|
70
|
+
g.data(:Blake, [41])
|
71
|
+
g.data(:Aaron, [42])
|
72
|
+
# g.data(:Grouch, [40])
|
73
|
+
# g.data(:Snuffleupagus, [43])
|
74
|
+
|
75
|
+
g.write("test/output/pie_nearly_equal.png")
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_pie_graph_equal
|
79
|
+
g = Gruff::Pie.new
|
80
|
+
g.title = "Pie Graph Equal"
|
81
|
+
|
82
|
+
g.data(:Bert, [41])
|
83
|
+
g.data(:Adam, [41])
|
84
|
+
|
85
|
+
g.write("test/output/pie_equal.png")
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_pie_graph_zero
|
89
|
+
g = Gruff::Pie.new
|
90
|
+
g.title = "Pie Graph One Zero"
|
91
|
+
|
92
|
+
g.data(:Bert, [0])
|
93
|
+
g.data(:Adam, [1])
|
94
|
+
|
95
|
+
g.write("test/output/pie_zero.png")
|
96
|
+
end
|
97
|
+
|
98
|
+
|
99
|
+
def test_pie_graph_one_val
|
100
|
+
g = Gruff::Pie.new
|
101
|
+
g.title = "Pie Graph One Val"
|
102
|
+
|
103
|
+
g.data(:Bert, 53)
|
104
|
+
g.data(:Adam, 29)
|
105
|
+
|
106
|
+
g.write("test/output/pie_one_val.png")
|
107
|
+
end
|
108
|
+
|
109
|
+
|
110
|
+
def test_wide
|
111
|
+
g = setup_basic_graph('800x400')
|
112
|
+
g.title = "Wide Pie"
|
113
|
+
g.write("test/output/pie_wide.png")
|
114
|
+
end
|
115
|
+
|
116
|
+
def test_label_size
|
117
|
+
g = setup_basic_graph()
|
118
|
+
g.title = "Pie With Small Legend"
|
119
|
+
g.legend_font_size = 10
|
120
|
+
g.write("test/output/pie_legend.png")
|
121
|
+
|
122
|
+
g = setup_basic_graph(400)
|
123
|
+
g.title = "Small Pie With Small Legend"
|
124
|
+
g.legend_font_size = 10
|
125
|
+
g.write("test/output/pie_legend_small.png")
|
126
|
+
end
|
127
|
+
|
128
|
+
|
129
|
+
def test_tiny_simple_pie
|
130
|
+
@datasets = (1..5).map {|n| ['Auto', [rand(100)]]}
|
131
|
+
|
132
|
+
g = setup_basic_graph 200
|
133
|
+
g.hide_legend = true
|
134
|
+
g.hide_title = true
|
135
|
+
g.hide_line_numbers = true
|
136
|
+
|
137
|
+
g.marker_font_size = 40.0
|
138
|
+
g.minimum_value = 0.0
|
139
|
+
|
140
|
+
write_test_file g, "pie_simple.png"
|
141
|
+
end
|
142
|
+
|
143
|
+
protected
|
144
|
+
|
145
|
+
def setup_basic_graph(size=800)
|
146
|
+
g = Gruff::Pie.new(size)
|
147
|
+
g.title = "My Graph Title"
|
148
|
+
@datasets.each do |data|
|
149
|
+
g.data(data[0], data[1])
|
150
|
+
end
|
151
|
+
return g
|
152
|
+
end
|
153
|
+
|
154
|
+
end
|