Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Shorten label from filename i graph

  • Loading branch information...
commit a636ce258e95903868b93470ca576b751d38e5a9 1 parent a274122
@psyeugenic authored
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/eplot_main.erl
View
12 src/eplot_main.erl
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.