public void saveChart(File file) throws IOException, PropertyException, ChartDataException {
Color[] poleBarev = Arrays.copyOfRange(COLORS, 0, legendLabels.length);
PieChart2DProperties properties = new PieChart2DProperties();
if (showChartLabels)
properties.setPieLabelType(PieLabelType.VALUE_LABELS);
PieChartDataSet dataset = new PieChartDataSet(title, data, legendLabels, poleBarev, properties);
LegendProperties legend = new LegendProperties();
legend.setNumColumns(1);
ChartProperties chartProperties = new ChartProperties();
chartProperties.setUseAntiAliasing(true);
PieChart2D chart = new PieChart2D(dataset, legend, chartProperties, width, height);