Bubble Chart + Line Chart

4 posts, 1 answers
  1. Chintu Bajaj
    Chintu Bajaj avatar
    2 posts
    Member since:
    Mar 2010

    Posted 25 Mar 2010 Link to this post

    Hello,

    Is there a way I can show a bubble chart with a line piercing through the center of each of the bubble?

    Sort of combining line chart and bubble chart.

    I want to use Silverlight with Telerik or any other control which can make this a possibility.

    Thanks,
    Chintu
  2. Answer
    Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 26 Mar 2010 Link to this post

    Hello Chintu Bajaj,

    You can achieve the desired functionality by defining two separate series -- one line and one bubble:

    DataSeries series = new DataSeries();
    series.Definition = new BubbleSeriesDefinition() { BubbleSizeRelative = false };
    series.Add(new DataPoint(21) { BubbleSize = 80 });
    series.Add(new DataPoint(30) { BubbleSize = 30 });
    series.Add(new DataPoint(10) { BubbleSize = 50 });
     
    DataSeries series2 = new DataSeries();
    series2.Definition = new LineSeriesDefinition();
    series2.Add(new DataPoint(21));
    series2.Add(new DataPoint(30));
    series2.Add(new DataPoint(10));
     
    RadChart1.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Inside;
    RadChart1.DefaultView.ChartArea.DataSeries.Add(series);
    RadChart1.DefaultView.ChartArea.DataSeries.Add(series2);



    All the best,
    Freddie
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Chintu Bajaj
    Chintu Bajaj avatar
    2 posts
    Member since:
    Mar 2010

    Posted 26 Mar 2010 Link to this post

    Thanks Freddie..  actually I got this working.

    I have a follow up question though.. I was trying to have different color per bubble and I had to create a different data series for each of the bubble (to get different color)... is there a way I can set different background color per bubble in the same series based on a  condition?

    For eg:
    val  between 5 & 10 === Yellow
    val  between 10 & 15 === green
    etc. etc.

    Note: My requirement was to have different size and color.. I could set different size using the DataPoint class but not color.

    Thanks,
    Chintu
  4. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 26 Mar 2010 Link to this post

    Hi Chintu Bajaj,

    You can use the MVVM approach demonstrated here (documentation here). We have attached a sample application to get you started as well.

    Hope this helps.


    All the best,
    Freddie
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top