How to customize a tooltip of CategoryPlot items in JFreeChart?

前端 未结 1 1994
忘掉有多难
忘掉有多难 2020-12-10 22:57

I need to change the format of the default tooltip in the bars drawn in the plot of a chart.

I don\'t know if my direction of looking at the problem is right. I am l

相关标签:
1条回答
  • 2020-12-10 23:19

    The StandardCategoryToolTipGenerator sets the MessageFormat ArgumentIndex values to the series, category and value. Try this example on your plot.

    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator(
        "Series {0}, Category {1}, Value {2}", NumberFormat.getInstance()));
    
    0 讨论(0)
提交回复
热议问题