Jump to content
JChartFX Community
  • 0
Sign in to follow this  
Matyooo

Can line chart with incomplete data display only sections of lines??

Question

I am currently creating an analytics webapp and evaluating jChartFX for it. Most of the things we need can be done through the API but there is a feature that we need but could not figure out whether it would be possible or not:
 
The task would be to display a line chart with multiple series that does not have data for all points in all series. The required behaviour would be to not to show that section of the series where data is not available and show it if data is present for it. Is there a way to do this? do you plan to add this functionality?
 
The best way to do this would be a special value in the series similar to a not_a_number notation in the json for the missing data like:
 
E.G. : using one of the samples from the API, I would like to pass data which is not complete for all series, and has NaN (which I know is not legal in javascript) as sign of missing data:
var items = [{
        "Month": "Jan",
        "White": 12560,
        "Red": 23400,
        "Sparkling": 34500
    }, {
        "Month": "Feb",
        "White": NaN      --  or should be null ??
        "Red": 21000,
        "Sparkling": 38900
    }, {
        "Month": "Mar",
        "White": 16700,
        "Red": 17000,
        "Sparkling": 42100
    }, {
        "Month": "Apr",
        "White": 12000,
        "Red": 19020,
        "Sparkling": 43800
    }];
 
Is there any mechanism of API calls that can do this or mimic this behavior by turning off sections of a line?
 
thanks,
Mat
 
 
  • Like 1

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

We support incomplete data, if there is a missing property (note that we discover available properties by looking at first object in the array), e.g.

 

    chart1.setDataSource([{"A":10},{"A":12},{"A":14},{},{"A":20},{"A":17},{"A":13},{},{"A":20},{"A":17},{"A":13}]);
 
We also define a value that we use to break the lines (we do not use NaN or null for this purpose) so you could also pass the following array
 
    chart1.setDataSource([{"A":10},{"A":12},{"A":14},{"A":cfx.Chart.Hidden},{"A":20},{"A":17},{"A":13},{"A":cfx.Chart.Hidden},{"A":20},{"A":17},{"A":13}]);
 
We have discovered an issue in a recent build of CoreVector where only the last line segment might be displayed and should have a bug fix soon, in the meantime if you experience this problem you can use CoreBasic.
 
Regards,
 
JuanC

Share this post


Link to post
Share on other sites
  • 0

Thanks! 

 

This constant cfx.Chart.Hidden is exactly what I was looking for. 

Just a small remark: as I create the JSON in Java and send it as a response for an ajax request, I cannot put cfx.Chart.Hidden into the json string. I must use its value directly: 1e+108.

 

Regards,

Mat

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...