Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am generating a dynamic chart (XYLineChart) using jFreeChart and I have a field which is not included in the dataset. The field is generated dynamically. I want to include that in my tooltip. Is there any possibility I can do it ?

Here is the flow of the program:

Create Chart using an empty dataset.

Set chartPanel. (I guess here is the place where we define the TooltipGenerator).

Receive dynamic data from socket.

Add data to the dataset. ( Here is the only place where I have the data which I need to have in my tooltip text).

Refresh Chart.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
472 views
Welcome To Ask or Share your Answers For Others

1 Answer

The name to be displayed is not included anywhere in the dataset.

As shown here for a custom XYItemLabelGenerator, you can extend a suitable dataset, e.g. AbstractXYDataset, to include the required information and access it from your implementation of XYToolTipGenerator.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...