Bubble Chart

8 posts, 0 answers
  1. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 25 Mar 2011 Link to this post

    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
  2. scorp
    scorp avatar
    59 posts
    Member since:
    Dec 2010

    Posted 25 Mar 2011 Link to this post

    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.
  3. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 28 Mar 2011 Link to this post

    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
  4. scorp
    scorp avatar
    59 posts
    Member since:
    Dec 2010

    Posted 11 Apr 2011 Link to this post

  5. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 12 Apr 2011 Link to this post

    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
  6. scorp
    scorp avatar
    59 posts
    Member since:
    Dec 2010

    Posted 12 Apr 2011 Link to this post

    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.
  7. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 15 Apr 2011 Link to this post

    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
Back to Top