3

It is possible to use HTML in JFreeChart tooltips?

I extend StandardCategoryToolTipGenerator and override method generateToolTip

public String generateToolTip(Dataset dataset, int row,
        int column, int row) {

    return "<h1>ToolTips on line 1<\\h1> <br /> Second line tooltip"

}

But it is displaying whole string instead. Does anyone know how to display html text in jfrechart tooltips?

user925531
  • 91
  • 5

1 Answers1

1

Use a CategoryURLGenerator, illustrated here for the homologous PieURLGenerator.

Addendum: As the tool tips are not Swing components, HTML is not supported. You can retrieve the result from your chosen URL generator in a ChartMouseListener to achieve any desired result.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • Using URL generator I will generate URL link for some part of the chart. What I want ,it is simply to display a tooltip having HTML inside.(for example multilene tooltip) – user925531 Sep 06 '11 at 09:32
  • Sorry, I overlooked the essential aspect of your question; I've elaborated above. – trashgod Sep 06 '11 at 10:46