EasyXLS
http://forum.easyxls.com/

How to create a Bubble Chart?
http://forum.easyxls.com/viewtopic.php?f=5&t=737
Page 1 of 1

Author:  mariodagot [ Wed Oct 01, 2008 4:22 am ]
Post subject:  How to create a Bubble Chart?

Hi,

How can I define series to a Bubble Chart.
For example, having the fallowing excel table:

Name; x; y; z
Serie 1; 22,00; 79,00; 79,00
Serie 2; 14,00; 89,00; 89,00


I've tried:


Code:
  ExcelChart xlsChart = new ExcelChart(0, 0, 600, 300);

  ExcelSeries serie = null;

  serie = new ExcelSeries("A1", "A2:A4");
  xlsChart.easy_addSeries(serie);
  serie = new ExcelSeries("B1", "B2:B4");
  xlsChart.easy_addSeries(serie);


But this doen't create the chart as expected.

Thanks in advance.
Regards

Author:  oana [ Thu Oct 02, 2008 5:16 am ]
Post subject:  How to create a Bubble Chart?

Hi,

Please check our online manual
http://www.easyxls.com/manual/index.html
chapter EasyXLS Basics/Charts/Chart Sheets

Please use Chart.CHART_TYPE_BUBBLE for setting the type of chart you need.

See also EasyXLS Basics/Charts/Chart in a Worksheet

Author:  mariodagot [ Thu Oct 09, 2008 10:01 am ]
Post subject: 

Hi again,

I've tried and can't find a way to create the chart as needed.

Does anyone have an example?
Here's my code, what am I doing wrong?

Code:
ExcelChart xlsChart = ...

ExcelSeries serie = null;
serie = new ExcelSeries("RAW_OverallResults!$A$5:$A$5", "=RAW_OverallResults!$B$5:$B$5");
xlsChart.easy_addSeries(serie);
serie = new ExcelSeries("=RAW_OverallResults!$A$6:$A$6", "=RAW_OverallResults!$B$6:$B$6");
xlsChart.easy_addSeries(serie);
serie = new ExcelSeries("=RAW_OverallResults!$A$7:$A$7", "=RAW_OverallResults!$B$7:$B$7");
xlsChart.easy_addSeries(serie);
xlsChart.easy_setCategoryXAxisLabels("=RAW_OverallResults!$C$5:$C$7");


And this is my data:

Quote:
SERIE_NAME PERCENTAGE VALUE PERCENTAGE-2
S-3 72,97% 192,62 100,00%
S-2 76,92% 253,09 100,00%
S-1 76,92% 337,36 100,00%



Thanks for your help.

Regards,
Mário

Author:  oana [ Fri Oct 10, 2008 5:21 am ]
Post subject:  How to create a Bubble Chart?

Hi,

The code below should help you:

Code:
ExcelDocument xls = new ExcelDocument(1);
xls.easy_addWorksheet("BubbleChart");

//set here the cell values
.............

//set the chart
ExcelChart xlsChart = new ExcelChart(0, 0, 600, 300);

xlsChart.easy_addSeries("A1", "=BubbleChart!$A$2:$A$4");
xlsChart.easy_addSeries("B1", "=BubbleChart!$B$2:$B$4");
xlsChart.easy_setChartType(Chart.CHART_TYPE_BUBBLE);

((ExcelWorksheet)xls.easy_getSheet("BubbleChart")).easy_addChart(xlsChart);

Author:  mariodagot [ Thu Oct 30, 2008 8:49 am ]
Post subject: 

Hi,

Thanks for the help.

Unfortunately that doesn't solve completely my problem.
I need to set the axys X values.

What I've found is that I can't create the chart I want using the table as it is.

For the bubble chart I always need to have an X value for each Y.
In my example, I had 3 series (3 Ys values):

Quote:
SERIE_NAME PERCENTAGE (Y) VALUE (X) PERCENTAGE-2 (Z)
S-3 72,97% 192,62 100,00%
S-2 76,92% 253,09 100,00%
S-1 76,92% 337,36 100,00%


It had to be replaced by:

Quote:
VALUE S-3 S-2 S-1
192,62 72,97% 0 0
253,09 0 76,92% 0
337,36 0 0 76,92%


This way it works <- src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /> with minor adaptations to the previous posted code.

Hope this helps someone.

Regards.

Page 1 of 1 All times are UTC - 4 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/