0

Can anyone tell me how to override the XYSeries.add() method, to add a 3rd argument as a String, so that the String text then lies inside the plot area? Thanks.

Wool
  • 138
  • 1
  • 10
ch.Joshi elijah
  • 103
  • 2
  • 11
  • 1
    It sounds more like you need to extend from `XYSeries` class adding a new method that takes a different number of arguments instead of overriding an existing one. In any case as is this question is too broad to be answered. – dic19 Nov 08 '17 at 12:18
  • 1
    And you will almost certainly need to subclass the renderer for your chart too so as to actually display the Strings – SteveR Nov 08 '17 at 22:48
  • 1
    Possible duplicate of [*JFreeChart line chart with text at each point*](https://stackoverflow.com/q/14458402/230513), which `extends AbstractXYDataset`. If this is not a duplicate, please [edit] your question to include a [mcve] that shows your revised approach. – trashgod Nov 09 '17 at 00:40
  • thanks .I will try your comments,if there is any link i can start with please share me @dic and steve.that(link) is not am looking for trashgod,there is a problem with that code try placing `ds.add(23, 50, "this a very long string");` in the dataset.the string is not included inside plot. – ch.Joshi elijah Nov 09 '17 at 05:09
  • The example uses an `XYItemLabelGenerator` and a `StandardXYToolTipGenerator`. – trashgod Nov 09 '17 at 19:49
  • yes,is there any approach to place string inside the plot with series collections for multiple series ? I am looking at ValueMarker but it allows only one axis value,what i can see is that we cant palce it at (x,y) coordinates.any help on that trashgod. – ch.Joshi elijah Nov 10 '17 at 04:45
  • Your implementation of `AbstractXYDataset` will have to handle multiple series; the example illustrates a single series. – trashgod Nov 11 '17 at 00:27
  • can that implementation keep text(3rd argument) inside the plot trashgod ? – ch.Joshi elijah Nov 13 '17 at 08:28

0 Answers0