【问题标题】:How to customize a tooltip of CategoryPlot items in JFreeChart?如何在 JFreeChart 中自定义 CategoryPlot 项目的工具提示?
【发布时间】:2012-02-14 02:34:40
【问题描述】:

我需要更改图表中绘制的条形中默认工具提示的格式。

我不知道我看待问题的方向是否正确。我正在查看 StandardCategoryToolTipGenerator 类的默认格式,即

DEFAULT_TOOL_TIP_FORMAT_STRING = "({0}, {1}) = {2}"

如何重新定义这个值?

提前致谢。

【问题讨论】:

    标签: java dataset plot tooltip jfreechart


    【解决方案1】:

    StandardCategoryToolTipGeneratorMessageFormat ArgumentIndex 值设置为 seriescategoryvalue。在你的情节上试试这个例子。

    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator(
        "Series {0}, Category {1}, Value {2}", NumberFormat.getInstance()));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-07
      • 1970-01-01
      • 2022-01-12
      • 2010-09-21
      • 1970-01-01
      • 2016-02-27
      相关资源
      最近更新 更多