Package com.atlassian.jira.charts
Interface ChartFactory
- All Known Implementing Classes:
DefaultChartFactory
public interface ChartFactory
Main entry point for charting in JIRA. This factory can be used to generate the different types of charts that are
used in JIRA. It returns a generic Chart object that contains all the information required to render the generated
chart. This ensures that we can switch to a different charting framework at some stage in the future.
- Since:
- v4.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Provides context for rendering a chart that is needed by all chart types.static enum
Defines the period for which data in the charts will be grouped.static enum
Defines what version labels to show in a chart that supports this feature. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptiongenerateAverageAgeChart
(ChartFactory.ChartContext context, int days, ChartFactory.PeriodName periodName) Generates what is essentially a bar chart showing the average time that issues have been open for over time.generateCreatedVsResolvedChart
(ChartFactory.ChartContext context, int days, ChartFactory.PeriodName periodName, ChartFactory.VersionLabel versionLabels, boolean cumulative, boolean showUnresolvedTrend) Generates a created vs resolved line graph, showing the difference between created and resolved issues.generateDateRangeTimeChart
(ChartFactory.ChartContext context, int days, ChartFactory.PeriodName periodName, long yAxisTimePeriod, String labelSuffixKey, String dateFieldId) Generates a date range chart time, meaning a chart that shows time values for particular date ranges.generatePieChart
(ChartFactory.ChartContext context, String statisticType) Generates a pie chart for a particular field.generateRecentlyCreated
(ChartFactory.ChartContext context, int days, ChartFactory.PeriodName periodName) Generates a stacked bar chart showing the number of created/resolved issues for a certain time period.generateTimeSinceChart
(ChartFactory.ChartContext context, int days, ChartFactory.PeriodName periodName, boolean cumulative, String dateFieldId) Generates a chart showing the number of issues since a certain date field.
-
Field Details
-
FRAGMENT_IMAGE_HEIGHT
static final int FRAGMENT_IMAGE_HEIGHT- See Also:
-
FRAGMENT_IMAGE_WIDTH
static final int FRAGMENT_IMAGE_WIDTH- See Also:
-
PORTLET_IMAGE_HEIGHT
static final int PORTLET_IMAGE_HEIGHT- See Also:
-
PORTLET_IMAGE_WIDTH
static final int PORTLET_IMAGE_WIDTH- See Also:
-
REPORT_IMAGE_HEIGHT
static final int REPORT_IMAGE_HEIGHT- See Also:
-
REPORT_IMAGE_WIDTH
static final int REPORT_IMAGE_WIDTH- See Also:
-
-
Method Details
-
generateCreatedVsResolvedChart
Chart generateCreatedVsResolvedChart(ChartFactory.ChartContext context, int days, ChartFactory.PeriodName periodName, ChartFactory.VersionLabel versionLabels, boolean cumulative, boolean showUnresolvedTrend) Generates a created vs resolved line graph, showing the difference between created and resolved issues.- Parameters:
context
- Basic information needed to generate all chartsdays
- Number of days to go back in time for the chartperiodName
- Defines if the data will be grouped in days, weeks, months...versionLabels
- Defines what version labels to show in the chartcumulative
- Display cumulative totals for the resolved and unresolved issuesshowUnresolvedTrend
- Displays a subgraph showing the trend at which issues are being resolved- Returns:
- A chart object containing all the information required to display the chart.
-
generateDateRangeTimeChart
Chart generateDateRangeTimeChart(ChartFactory.ChartContext context, int days, ChartFactory.PeriodName periodName, long yAxisTimePeriod, String labelSuffixKey, String dateFieldId) Generates a date range chart time, meaning a chart that shows time values for particular date ranges. For example the total resolution time for issues in any given time period.- Parameters:
context
- Basic information needed to generate all chartsdays
- Number of days to go back in time for the chartperiodName
- Defines if the data will be grouped in days, weeks, months...yAxisTimePeriod
- Time period in millis to display on the yAxis. Only supports Hours and DayslabelSuffixKey
- The i18n suffix key to display for mouse tool tips in the chartdateFieldId
- The date field to use as the basis for the times displayed per date range- Returns:
- A chart object containing all the information required to display the chart.
-
generatePieChart
Generates a pie chart for a particular field. For example, this may generate a pie chart showing how many issues are in each issue type available. SeeFilterStatisticsValuesGenerator
for possible values for the statisticType. Custom fields are also supported by simply entering the 'customfield_' for the statisticType. - Parameters:
context
- Basic information needed to generate all chartsstatisticType
- The field for which to generate the pie slices.- Returns:
- A chart object containing all the information required to display the chart.
-
generateAverageAgeChart
Chart generateAverageAgeChart(ChartFactory.ChartContext context, int days, ChartFactory.PeriodName periodName) Generates what is essentially a bar chart showing the average time that issues have been open for over time.- Parameters:
context
- Basic information needed to generate all chartsdays
- Number of days to go back in time for the chartperiodName
- Defines if the data will be grouped in days, weeks, months...- Returns:
- A chart object containing all the information required to display the chart.
-
generateRecentlyCreated
Chart generateRecentlyCreated(ChartFactory.ChartContext context, int days, ChartFactory.PeriodName periodName) Generates a stacked bar chart showing the number of created/resolved issues for a certain time period.- Parameters:
context
- Basic information needed to generate all chartsdays
- Number of days to go back in time for the chartperiodName
- Defines if the data will be grouped in days, weeks, months...- Returns:
- A chart object containing all the information required to display the chart.
-
generateTimeSinceChart
Chart generateTimeSinceChart(ChartFactory.ChartContext context, int days, ChartFactory.PeriodName periodName, boolean cumulative, String dateFieldId) Generates a chart showing the number of issues since a certain date field. For example if the 'Created' field is selected, this chart will show the number of issues created for each date in the past (depending on period and days previously selected). Please note that the dateField must be a Field marked byDateField
.- Parameters:
context
- Basic information needed to generate all chartsdays
- Number of days to go back in time for the chartperiodName
- Defines if the data will be grouped in days, weeks, months...cumulative
- Display cumulative totals for the number of issuesdateFieldId
- The date field to use as the basis for the times displayed per date range- Returns:
- A chart object containing all the information required to display the chart.
-