We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how to create bubble chart

Thread ID:

Created:

Updated:

Platform:

Replies:

126080 Sep 22,2016 09:41 AM UTC Oct 3,2016 10:44 AM UTC UWP 4
loading
Tags: XlsIO
Sharad Kumar
Asked On September 22, 2016 09:41 AM UTC

Hi,

I am try to create bubble chart . I am successful create chart series but X value for series is not set  and bubble size is not set.
I am using following this code.            

IWorksheet osheet = oWorBook.Workshhets[0];
IChartshapes ocharts = osheet.Charts;
IChartshape  ochart = ocharts.Add();
IChartSeries oseries = ochart.Series;
IChartSerie oserie = = oseries.Add();

oSerie.values = osheet.Range[A1:A23];                   ->  x values is not set
oSeire.SeriesType = ExcelChartType.Bubble;
oSeries.vales = osheet.Range[B1:B23];                   ->   y value is set    

and bubble size is ={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};   

Please find the Excel file.
                         

Thanks

Attachment: 8Bubblechart2check_19a67e3.zip

Abirami Varadharajan [Syncfusion]
Replied On September 23, 2016 03:32 PM UTC

Hi Sharad, 
  
Thank you for contacting Syncfusion support. 
  
The Bubble size of series can be set though EnteredDirectlyBubbles and Bubbles properties of chart series. The following code snippet illustrates this behavior. 
 
Code Example: 
//setting bubble size through an array. 
(serie.EnteredDirectlyBubbles = new object[]{1,1,1,1,1,1,1,1,1,1}; 
(OR) 
//setting bubble size through range value. 
serie.Bubbles = worksheet.Range["B2:B10"]; 
  
             
  
  
  
We have prepared sample for your scenario and shared it for your reference which can be downloaded from following location. 
  
  
Kindly refer it and let us know whether your requirement is fulfilled. 
  
Regards, 
Abirami. 


Sharad Kumar
Replied On September 26, 2016 05:42 AM UTC

thanks for replay.

if bubble size value is pass directly in function then after bubble size is set successfully.
oserie.EnteredDirectyBubble = new object[] {1,1,1,1,1,1,1,1,1,1,1}  


But In my case , bubble size value as a string type , then after bubble size is not set.
string bubbleSize = {1,1,1,1,1,1,1,1,1,1,1,1};
object[] yValue = (object[])bubbleSize;
oseries.EnteredDirectlyBubble = yValue;

How to convert string value to object[] array . which run to successfuly in bubble chart.

Thanks
sharad kumar

Abirami Varadharajan [Syncfusion]
Replied On September 27, 2016 01:25 PM UTC

Hi Sharad,
 
Thank you for updating us.
 
Bubble size type is Integer and it accepts only integer value. you can provide integer array as bubble size for the chart. Kindly refer below code snippet to achieve this.
 
Code Example:
 
            int[] bubbleSize = { 1, 1, 1, 1, 1, 1, 1, 1, 1};
            object[] yValue = new object[bubbleSize.Length];
            for(int i = 0; i < bubbleSize.Length; i++)
            {
                yValue[i] = bubbleSize[i];
            }
           
            serie.SerieType = ExcelChartType.Bubble;
            serie.EnteredDirectlyBubbles = yValue;
 
Please let us now if you have any concerns.
 
Regards,
Abirami.


Sharad Kumar
Replied On October 3, 2016 10:44 AM UTC



Thanks Abirami

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;