I am using jfree chart for graphically displaying metrics.Now I am working on a solution which randomizes graph elements in an XY line chart so that the graph looks smoother.The problem is I dont want the random elements to get the same thickness as the real values,in fact I dont wan’t any thickness associated with them.Is there a way to selectively specify point thickness.I am currently using XYLineAndShapeRenderer to render the point thickness.
Share
You can override
getItemShapeVisible()and arrange for it to returnfalsefor the spurious points. You can store the extra information required for the decision in your data model using an implementation ofXYZDataset.As an alternative, consider smoothing the data before rendering it. Such filters typically result in fewer points, which simplifies rendering.
In either case, avoid confusing or misleading changes to the data. A
TextTitle, shown here, may clarify the result.Addendum:
getItemShapeVisible()tells you whatseriesanditemis under consideration. The default implementation simply asksgetSeriesShapesVisible(). Here’s an outline:Addendum: Here’s how you might install it: