How to create High chart of type Bubble?

0

Hi,

I am using Jasper Studio 5.5. The Bubble chart is not available directly when we use "html5" chart element.

But in the  help, they have mentioned that we can create "Bubble" chart using customization options.

Can any one please guide me in how to acheive this?

Best Regards

Gowtham

gowthamsenmca's picture
Joined: Oct 15 2013 - 4:52am
Last seen: 4 years 4 months ago

This link will give a better understanding of the customizaiton options in regards to charts.

http://mdahlman.wordpress.com/2010/08/18/chart-customizers-1/

Hope this gets you going.

B.

Java_Jasper - 7 years 2 months ago

import java.text.DateFormat;
import java.text.FieldPosition;
import java.text.NumberFormat;
import java.text.ParsePosition;
import java.util.Date;
 
import net.sf.jasperreports.engine.JRAbstractChartCustomizer;
import net.sf.jasperreports.engine.JRChart;
 
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.NumberAxis;
 
public class BubbleDateCustomizer extends JRAbstractChartCustomizer

          public void customize(JFreeChart chart, JRChart jasperChart)
         {
                   NumberAxis domainAxis = (NumberAxis) chart.getXYPlot().getDomainAxis();
                   final DateFormat dateFormat = DateFormat.getDateInstance();
                  domainAxis.setNumberFormatOverride(new NumberFormat()
         {


        public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos)
       {
               return format((long) number, toAppendTo, pos);
        }
 
       public StringBuffer format(long number, StringBuffer toAppendTo, FieldPosition pos)
      {
               return dateFormat.format(new Date(number), toAppendTo, pos);
      }
 
      public Number parse(String source, ParsePosition parsePosition)
     {
            throw new UnsupportedOperationException();
     }
  });
 }
 

This example was written by Lucian a member on this community.

I am posting it as an example of a custom chart.

Java_Jasper - 7 years 2 months ago

2 Answers:

0

See commnet above, not sure if comments notify a user of a post.

Java_Jasper's picture
Joined: Jan 17 2012 - 10:13am
Last seen: 5 years 1 month ago
1

Hey I have the same need for a HTML5 Highchart type Bubble, link to chart

http://www.highcharts.com/demo/bubble-3d

The suggestion in the comments above apparently are related to the Standard chart type bubble, if I am not mistaken.

Cheers,

Leo

leo.arouca's picture
Joined: Jul 12 2013 - 2:25am
Last seen: 7 years 2 months ago

Awesome link!

Java_Jasper - 7 years 2 months ago
Feedback