Limit visible data and make the chart autoscrollable

5 posts, 1 answers
  1. Prashant
    Prashant avatar
    8 posts
    Member since:
    Sep 2015

    Posted 20 Jan Link to this post

    Hi,

     I have  bubble series with datetimecontinuous axis. I want to plot all data based but want to show data based on 20 datetime values on x axis at a time and rest chart should be scrollable. Also the chart must be scrolled to the most recent point at the time of loading. Is there any way to achieve it?

     

    Thanks,

    Prashant Bharti

  2. Prashant
    Prashant avatar
    8 posts
    Member since:
    Sep 2015

    Posted 21 Jan Link to this post

    Hi,

     Finally, i found a thread which provided partial solution of my requirement. I am still facing some more problems which are as follows:

    1) I am using Date Time Continuous axis as my X-axis. I am showing Weekdays on horizontal axis (Fri,Sat...). Is there a    simple way to start horizontal axis at "Sunday" and end at "Saturday"  .i.e. (Sun,Mon,Tue,Wed...) and plot data correspondingly.

    2) Is there any way to count total number of labels on horizontal axis because in one of the charts, i have to show data based on 20  date labels on x-axis and i am using DateTimeContinuous axis with setMajorStep(1). I have to show all the dates since the very first reading even if data not available corresponding to the date.

    3) How can i animate a PIE chart from center like moving needle in the clock.

     

    Thanks,

    Prashant

  3. DevCraft banner
  4. Todor
    Admin
    Todor avatar
    778 posts

    Posted 25 Jan Link to this post

    Hello Prashant,

    Thank you for your questions.

    1. Regarding the zoon and pan of the chart, you can refer to this forum post. However, there is no "easy way to define that the data will contain just one week - you will need to simulate it based on your data. For example if it contains data from 4 weeks, you can zoom the horizontal chart 4 times, which should lead to similar result.

    2. Here's how to see the number of labels on the horizontal axis:

    chart.getHorizontalAxis().getModel().ticks().size()

    3. More information about the animation in Chart for Android is available in its online documentation. If I understand correctly the desired outcome, you can create an animation group and include scale and rotate animations.

    I hope this information helps.

    Regards,
    Todor
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  5. Prashant
    Prashant avatar
    8 posts
    Member since:
    Sep 2015

    Posted 27 Jan Link to this post

    Hi,

     chart.getHorizontalAxis().getModel().ticks().size()......is not working in my case. It is always returning "0". I am dealing with bubble series and datetimecontinuous axis.

     

    Thanks,

    Prashant

  6. Answer
    Todor
    Admin
    Todor avatar
    778 posts

    Posted 01 Feb Link to this post

    Hello Prashant,

    The value of ticks is 0 initially since the labels haven't been drawn yet. You can add this code to layout change listener. Here's an example:

    chart.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
        @Override
        public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
            int labelsCount = chart.getHorizontalAxis().getModel().ticks().size();
        }
    });

    Let us know if you need further assistance.

    Regards,
    Todor
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner