com.atlassian.jira.charts.jfreechart
Class ChartHelper

java.lang.Object
  extended by com.atlassian.jira.charts.jfreechart.ChartHelper

public class ChartHelper
extends Object

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)

Since:
v4.0
See Also:
ChartUtils

Constructor Summary
ChartHelper(org.jfree.chart.JFreeChart chart)
           
ChartHelper(org.jfree.chart.JFreeChart chart, TempFileFactory tempFileFactory, ChartUtils chartUtils)
           
 
Method Summary
 void generate(int width, int height)
          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.
 org.jfree.chart.JFreeChart getChart()
           
 BufferedImage getImage()
          Retrieve image that has been generated with generateInline(int, int)
 String getImageMap()
          Deprecated. Use #getImageMapHtml
 String getImageMapHtml()
           
 String getImageMapName()
           
 String getLocation()
          Deprecated. use inline charts
 org.jfree.chart.ChartRenderingInfo getRenderingInfo()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartHelper

public ChartHelper(org.jfree.chart.JFreeChart chart)

ChartHelper

@Internal
public ChartHelper(org.jfree.chart.JFreeChart chart,
                            TempFileFactory tempFileFactory,
                            ChartUtils chartUtils)
Method Detail

getChart

public org.jfree.chart.JFreeChart getChart()

generateInline

public void generateInline(int width,
                           int height)
                    throws IOException
Generates chart "into the memory" which can be later retrieved via getImage() method.

Throws:
IOException

generate

@Deprecated
public void generate(int width,
                                int height)
              throws IOException
Deprecated. JRA-21854 images should be rendered using data uri. Please use generateInline(int, int)

Throws:
IOException
See Also:
getImage()

getRenderingInfo

public org.jfree.chart.ChartRenderingInfo getRenderingInfo()

getLocation

@Deprecated
public String getLocation()
Deprecated. use inline charts

See Also:
getImage(), ChartUtils

getImageMap

public String getImageMap()
Deprecated. Use #getImageMapHtml


getImageMapHtml

public String getImageMapHtml()
Since:
v6.0

getImageMapName

public String getImageMapName()

getImage

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

Returns:
generated image or null if the generateInline(int, int) method has not been used.


Copyright © 2002-2014 Atlassian. All Rights Reserved.