1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    7
    Vote Rating
    0
    RaKku is on a distinguished road

      0  

    Default LineChart question for skipping Y values in LineSeries

    LineChart question for skipping Y values in LineSeries


    Hi,
    I am pretty new to GXT and the forum, so I am hoping I am posting at the right place. So I have a bit of a question.


    Right now, I am going through the chart examples (http://www.sencha.com/examples/#ExamplePlace:linechart) and I have a question. I have noticed that for each series that is generated, it is assumed that for each X value there is a Y value present. I looked at the getData() method and it looks like your standard stuff of randomizing values for the demo. For example, for the Line Chart, each month in data1, data2, and data3 has a Y plot -fine.

    However, for example, what if the value of Y is not known for the month of May for data1? Right now, in the working example one has to put value of type Double in the Data class (in this case, I just put 0 since I don't know the value), but of course the line would dip down to 0. I can't pull NULL or any of that either since the data class is expecting an object of type Double.


    My question is, is there a way to "skip" that month and let the line plot from April to June smoothly instead of inserting a random number (like '0') and making the graph incorrect?


    Thanks, any help would be appreciated!


    -Ben

  2. #2
    Sencha - GXT Dev Team BrendanC's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Vote Rating
    3
    BrendanC is on a distinguished road

      0  

    Default


    If LineSeries encounters a Number that is of value null or Double.NaN it will not render a point for that data point. Additionally if you want a visible gap in the line to appear at that point you can use setGapless(false);

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    7
    Vote Rating
    0
    RaKku is on a distinguished road

      0  

    Default


    Quote Originally Posted by BrendanC View Post
    If LineSeries encounters a Number that is of value null or Double.NaN it will not render a point for that data point. Additionally if you want a visible gap in the line to appear at that point you can use setGapless(false);
    Great, that did the trick - thanks!

  4. #4
    Sencha User
    Join Date
    Jan 2015
    Posts
    5
    Vote Rating
    0
    swetabansal is on a distinguished road

      0  

    Default Rendering random values for null values in LineSeries

    Rendering random values for null values in LineSeries


    Plotting year vs price where price is BigDecimal (y-axis), Suppose for year 2007 Price1 is null and Price2 in not null.
    It is plotting random values for Price1 as well.

    series.setGapless(false) didn't help.

Thread Participants: 2