Yoo
Yoo

Reputation: 31

Jfreechart tooltip not working for timeseries

I'm trying to add a tooltip for the live (serial) data using a timeseries plot. However, the tooltip doesn't show up, so I'm not sure what is the problem and how I could fix it? Please suggest a way to solve this issue.

Upvotes: 1

Views: 723

Answers (1)

trashgod
trashgod

Reputation: 205775

Enable tooltips in your chosen ChartFactory. TimeSeriesChartDemo1, included in the distribution, is a complete example. From the source,

    JFreeChart chart = ChartFactory.createTimeSeriesChart(
        "Legal & General Unit Trust Prices",  // title
        "Date",             // x-axis label
        "Price Per Unit",   // y-axis label
        dataset
    );

note that ChartFactory.createTimeSeriesChart() enables tooltips by by default.

If needed, create a custom XYToolTipGenerator, as shown here.

Upvotes: 1

Related Questions