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

Bubble Chart

7 Answers 79 Views
Chart
This is a migrated thread and some comments may be shown as answers.

7 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 25 Mar 2011, 08:22 AM
Hi scorp,

A similar setup can be achieved. The code below demonstrates one possible approach:

public partial class Empty2 : UserControl
   {
       ObservableCollection<int> datasource = new ObservableCollection<int>();
       int value = 0;
       public Empty2()
       {
           InitializeComponent();
           RadChart1.ItemsSource = datasource;
           DispatcherTimer timer = new DispatcherTimer();
           timer.Interval = new TimeSpan(0, 0, 0, 1);
           timer.Tick += new EventHandler(timer_Tick);
           timer.Start();
           RadChart1.DefaultSeriesDefinition = new BubbleSeriesDefinition();
           RadChart1.DefaultView.ChartArea.EnableAnimations = false;
           RadChart1.DefaultView.ChartArea.AxisY.AutoRange = false;
           RadChart1.DefaultView.ChartArea.AxisY.MinValue = 0;
           RadChart1.DefaultView.ChartArea.AxisY.MaxValue = 100;
           RadChart1.DefaultView.ChartArea.AxisY.Step = 5;
       }
       void timer_Tick(object sender, EventArgs e)
       {
           datasource.Add(value);
           value++;
       }      
      
   }

I hope this gets you started properly.

Greetings,
Yavor
the Telerik team
0
scorp
Top achievements
Rank 1
answered on 25 Mar 2011, 03:18 PM
Thanks. What are some other approaches. I would like one where the x or y scale doesn't change and just the bubble moves from point a to point b to point c.
0
Yavor
Telerik team
answered on 28 Mar 2011, 09:00 AM
Hello scorp,

If you would like for an axis not to change, you can turn off it autoscale property. This may look something like this:

RadChart1.DefaultView.ChartArea.EnableAnimations = false;            
RadChart1.DefaultView.ChartArea.AxisY.AutoRange = false;
RadChart1.DefaultView.ChartArea.AxisY.MinValue = 0;
RadChart1.DefaultView.ChartArea.AxisY.MaxValue = 100;
RadChart1.DefaultView.ChartArea.AxisY.Step = 10;
RadChart1.DefaultView.ChartArea.AxisX.AutoRange = false;
RadChart1.DefaultView.ChartArea.AxisX.MinValue = 0;
RadChart1.DefaultView.ChartArea.AxisX.MaxValue = 100;
RadChart1.DefaultView.ChartArea.AxisX.Step = 5;

In such a setup, the axes will be of fixed dimensions, and simply new points will be added once per tick.

Kind regards,
Yavor
the Telerik team
0
scorp
Top achievements
Rank 1
answered on 11 Apr 2011, 04:22 PM
0
Yavor
Telerik team
answered on 12 Apr 2011, 07:31 AM
Hi scorp,

Presently, this precise animation is hard to achieve. Nevertheless, you can use the present approach to match the setup closely.

Kind regards,
Yavor
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
scorp
Top achievements
Rank 1
answered on 12 Apr 2011, 02:53 PM
Not sure if you got my question correctly. I was looking to get the trail of the bubble. There is a checkbox in the link I provided to get the trail.
Thanks.
0
Yavor
Telerik team
answered on 15 Apr 2011, 06:14 AM
Hi scorp,

Presently, this trailing effect is not available. This can also be simulated, however. The default behavior of the control is to update each datapoint to a new value. You can alter this, by simply adding a new datapoint for each new value, and preserving the old ones. Thus the older values will also be available on the screen.
I hope this information helps.

Regards,
Yavor
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
scorp
Top achievements
Rank 1
Answers by
Yavor
Telerik team
scorp
Top achievements
Rank 1
Share this question
or