public class

ChartHelper

extends Object
java.lang.Object
   ↳ com.atlassian.jira.charts.jfreechart.ChartHelper

Class Overview

A nice utility class to manage the generation of a charts.

The original implementation use jfreechart's one time image mechanism which can lead to JRA-21854.

New implementation is using data uri mechanism (inlining base64 encoded images directly) so the generate(int, int) and getLocation() methods are here just for backward compatibility.

When you are going to create new kind of chart you should use generateInline(int, int) instead of generate(int, int)

See Also

Summary

Public Constructors
ChartHelper(JFreeChart chart)
@Internal ChartHelper(JFreeChart chart, TempFileFactory tempFileFactory, ChartUtils chartUtils)
Public Methods
@Deprecated void generate(int width, int height)
This method is deprecated. JRA-21854 images should be rendered using data uri. Please use generateInline(int, int)
void generateInline(int width, int height)
Generates chart "into the memory" which can be later retrieved via getImage() method.
JFreeChart getChart()
BufferedImage getImage()
Retrieve image that has been generated with generateInline(int, int)
String getImageMap()
This method is deprecated. Use #getImageMapHtml
String getImageMapHtml()
String getImageMapName()
@Deprecated String getLocation()
This method is deprecated. use inline charts
ChartRenderingInfo getRenderingInfo()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ChartHelper (JFreeChart chart)

@Internal public ChartHelper (JFreeChart chart, TempFileFactory tempFileFactory, ChartUtils chartUtils)

@Internal

This constructor is an internal implementation detail and will change without notice.

Clients that depend on @Internal classes and interfaces can not expect to be compatible with any version other than the version they were compiled against (even minor version and milestone releases may break binary compatibility with respect to @Internal elements).

Public Methods

@Deprecated public void generate (int width, int height)

This method is deprecated.
JRA-21854 images should be rendered using data uri. Please use generateInline(int, int)

Throws
IOException
See Also

public void generateInline (int width, int height)

Generates chart "into the memory" which can be later retrieved via getImage() method.

Throws
IOException

public JFreeChart getChart ()

public BufferedImage getImage ()

Retrieve image that has been generated with generateInline(int, int)

Returns

public String getImageMap ()

This method is deprecated.
Use #getImageMapHtml

public String getImageMapHtml ()

public String getImageMapName ()

@Deprecated public String getLocation ()

This method is deprecated.
use inline charts

public ChartRenderingInfo getRenderingInfo ()