Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
ChartGenerator | 34 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.chart; | |
21 | ||
22 | import java.util.Map; | |
23 | ||
24 | import org.xwiki.chart.model.ChartModel; | |
25 | import org.xwiki.component.annotation.Role; | |
26 | ||
27 | /** | |
28 | * A component interface for defining various chart generators. | |
29 | * | |
30 | * @version $Id: 14b8a6b21af060c7fbc187073b7378a671593bdc $ | |
31 | * @since 2.0M1 | |
32 | */ | |
33 | @Role | |
34 | public interface ChartGenerator | |
35 | { | |
36 | /** | |
37 | * Title parameter identifier. | |
38 | */ | |
39 | String TITLE_PARAM = "title"; | |
40 | ||
41 | /** | |
42 | * Height parameter identifier. | |
43 | */ | |
44 | String HEIGHT_PARAM = "height"; | |
45 | ||
46 | /** | |
47 | * Width parameter identifier. | |
48 | */ | |
49 | String WIDTH_PARAM = "width"; | |
50 | ||
51 | /** | |
52 | * Type parameter identifier. | |
53 | */ | |
54 | String TYPE_PARAM = "type"; | |
55 | ||
56 | /** | |
57 | * Source parameter identifier. | |
58 | */ | |
59 | String SERIES_PARAM = "series"; | |
60 | ||
61 | /** | |
62 | * Generates an image of a chart representing the data presented as a {@link ChartModel} and extra formatting | |
63 | * parameters provided in the parameters map. | |
64 | * | |
65 | * @param model the {@link ChartModel} which defines the data model to be represented by the chart. | |
66 | * @param parameters extra parameters for controlling various features of the image output. | |
67 | * @return the chart image (binary). | |
68 | * @throws ChartGeneratorException if the {@link ChartGenerator} is unable to render a chart. | |
69 | */ | |
70 | byte[] generate(ChartModel model, Map<String, String> parameters) throws ChartGeneratorException; | |
71 | } |