开发者

JfreeChart tooltips with HTML code inside

开发者 https://www.devze.com 2023-04-01 20:16 出处:网络
It is possible to use HTML in JFreeChart tooltips? I extend StandardCategoryToolTipGenerator and override method generateToolTip

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"

}
开发者_如何学Go

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号