Permalink
Browse files

Shorten label from filename i graph

  • Loading branch information...
1 parent a274122 commit a636ce258e95903868b93470ca576b751d38e5a9 @psyeugenic committed Mar 13, 2013
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/eplot_main.erl
View
@@ -50,13 +50,15 @@ graph_binary(plot2d,Data, Options) ->
egd_chart:graph(Data, Options);
graph_binary(bar2d, Data, Options) ->
egd_chart:bar2d(Data, Options);
-graph_binary(Type, _, _) -> io:format("Bad engine: ~p~n", [Type]), exit(unnormal).
+graph_binary(Type, _, _) ->
+ io:format("Bad engine: ~p~n", [Type]),
+ exit(bad_plot_engine).
-parse_data_files(Filenames) -> parse_data_files(Filenames, []).
-parse_data_files([], Out) -> lists:reverse(Out);
-parse_data_files([Filename|Filenames], Out) ->
+parse_data_files([]) -> [];
+parse_data_files([Filename|Filenames]) ->
Data = parse_data_file(Filename),
- parse_data_files(Filenames, [{Filename, Data}|Out]).
+ Name = filename:basename(Filename),
+ [{Name, Data}|parse_data_files(Filenames)].
merge_options([], Out) -> Out;

0 comments on commit a636ce2

Please sign in to comment.