You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
721 B
27 lines
721 B
package com.crawler.chart.impl;
|
|
|
|
import com.crawler.chart.ChartGenerator;
|
|
import com.crawler.model.Movie;
|
|
import com.crawler.ui.MovieResultDisplay;
|
|
|
|
import java.io.IOException;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class RatingDistributionChartGenerator implements ChartGenerator {
|
|
@Override
|
|
public void generateChart(Movie[] movies) {
|
|
List<Movie> movieList = List.of(movies);
|
|
try {
|
|
MovieResultDisplay.generateRatingDistributionChart(movieList);
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public String getChartName() {
|
|
return "Rating Distribution Chart";
|
|
}
|
|
}
|