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.

Bubbles are overlapping for two same coordinates in bubble chart

Thread ID:

Created:

Updated:

Platform:

Replies:

120033 Aug 25,2015 10:46 AM Aug 26,2015 07:13 AM JavaScript 1
loading
Tags: ejChart
Gitesh
Asked On August 25, 2015 10:46 AM

Is there's any way to differentiate overlapped bubbles ?

Sanjith Kesavan [Syncfusion]
Replied On August 26, 2015 07:13 AM

Hi Gitesh,
Thanks for using Syncfusion product.
We have analyzed your query. We can differentiate the overlapping bubble by changing the opacity.  Please find the below code example
[JS]                        

$("#container").ejChart(
{

load: "loadTheme",

seriesRendering: "seriesRender",

});



function seriesRender(sender) {

   var x = [];

   var y = [];          

   for (var i = 0; i < sender.data.series.points.length; i++) {

       x.push(sender.data.series.points[i].x);           

        y.push(sender.data.series.points[i].y);

  }       

   var a = arrhasDup(x);

   var b = arrhasDup(y);

   index1 = x.indexOf(a[0]);

   index2 = y.indexOf(b[0]);

   if (index1 == index2) {

      sender.data.series.points[index1].opacity = 0.5;

   }

}

function arrhasDup(x) {

   var a = [];

   n = x.length;

   for (i = 0; i < n; i++) {

        for (j = i + 1; j < n; j++) {

            if (x[i] == x[j])

                a.push(x[j]);

        }

   }

  return a;
}

In the above code we have checked whether bubbles are overlapping or not in the seriesRendering event. If the bubbles are overlapped means we have set the opacity of the bubble as 0.5


Please find the below screenshot



In the above screen shot opacity of the overlapped bubble has been changed.


We have prepared the sample as per your requirement. Please find the sample from below location

Sample Link : http://www.syncfusion.com/downloads/support/forum/120033/ze/bubble1184476818

Please let us know if you have any queries.


Regards,

Sanjith K.​


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.

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.

;