Is it possible to hide individual points or sections of a line chart?
Is it possible to hide individual points or sections of a line chart?
Hi I am a newbie to gxt and I am trying to solve a particular problem. I have modified the LineExample (which draws a line chart) which comes with the gxt-3.0.0-beta2 download; see the attached screenshot, “chartLine1.jpg”. The x-axis goes from Jan to Dec and y-axis goes from 0 to 100. Basically what I would like to do is to have a gap show up in the line chart i.e. have the line display from Jan to Feb than show a gap (no line) from Feb to Apr and display the line again for Apr to Dec. If I remove the I simply remove the point (Mar) from the data store using “store(2)” I get the line chart with the point missing and no gap, see the attached screenshot, “chartLine2.jpg”. Any help is greatly appreciated. Thanks in advance! Victor
You can over ride setLabelProvider, to create a gap on the TimeAxis.
For example like this.
time.setLabelProvider(new LabelProvider<Date>() {
@Override
// Otherwise show empty
public String getLabel(Date item) {
//Your logic of gap based on the item.
}
});
Related to this I have changed numeric axis and line series to handle values it cannot display like null and NaN. This could be used to create a gap between line series. This change is in SVN and will be in the next release.
I have also just added a change in SVN for a gapless boolean on line series. Non-gapless series will use moveto instead of lineto for the path across gaps.