Menu

avoid best fit (axis X in time)

Help
Anonymous
2015-04-01
2015-05-20
  • Anonymous

    Anonymous - 2015-04-01

    Hi, i have a chart displaying 1000 points and an X axis time formatted.
    The problem is that when I have just few points (3 for example), the points arrive at the right to best fit the screen.
    What I would like is to avoid that and have a fixed scale, and when 1000 points are drawn, the firsts go left. Is it possible to do that?
    Thanks

     
  • Anonymous

    Anonymous - 2015-04-03

    nobody ? :p

     
  • Anonymous

    Anonymous - 2015-05-18

    I can think of 2 options. However, I'm not that familiar with the library yet, so there may be better alternatives.

    1) Use a different viewport policy, e.g.,

    Range xRange = new Range(minX, maxX);
    IRangePolicy policy = new RangePolicyFixedViewport(xRange);
    chart.getAxisX().setRangePolicy(policy);

    2) Initialize points as NaN and replace the ones you want to update

     

    Last edit: Anonymous 2015-05-18
  • Achim Westermann

    My bet: 1) works. Never tested 2). 1) adds complexity O(1) while 2) adds O(n) (where n is amount of points).

     

Anonymous
Anonymous

Add attachments
Cancel