This is a migrated thread and some comments may be shown as answers.

Bubble Chart + Line Chart

3 Answers 105 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Chintu Bajaj
Top achievements
Rank 1
Chintu Bajaj asked on 26 Mar 2010, 04:05 AM
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

3 Answers, 1 is accepted

Sort by
0
Accepted
Giuseppe
Telerik team
answered on 26 Mar 2010, 09:38 AM
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.
0
Chintu Bajaj
Top achievements
Rank 1
answered on 26 Mar 2010, 10:30 AM
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
0
Giuseppe
Telerik team
answered on 26 Mar 2010, 02:08 PM
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.
Tags
Chart
Asked by
Chintu Bajaj
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Chintu Bajaj
Top achievements
Rank 1
Share this question
or