When I use the mouse point to the bar, it shows USD/GBP: X=1

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Carrie

When I use the mouse point to the bar, it shows USD/GBP: X=1

Post by Carrie » Wed Feb 12, 2003 4:16 am

I have used BasicTimeSeries to create dataset and modify the createUSDTimeSeries to creatMyTimeSeries and then use createVerticalXYBarChart to create the chart

When I use the mouse point the bar, it shows
USD/GBP: X=1,036,080,000,000, y=9

What is the value of x mean?
Is the the day time??
If yes, how can I convert it back to date (and where to do it)

If Not, can I disable the message (and how to do it)??

Anyone can help? It's urgent. Many Thanks :)

Carrie

Arnaud

Re: When I use the mouse point to the bar, it shows USD/GBP:

Post by Arnaud » Thu Feb 13, 2003 12:01 pm

Hello,

What You see when "When You use the mouse point the bar" is the Tooltip. It is extra information about the datapoint where Your mouse is located.

You can set the tooltip off, or customize it with special formatter, or even write You owns TooltipsGenerator classes.

By default, the createVerticalXYBarChart() method in the ChartFactory uses a StandardXYToolTipGenerator()...

I'm not very familiar yet with the all API, but You could perhaps set the toolTipsGenerator of Your renderer (method setToolTipGenerator in XYItemRenderer) to a TimeSeriesToolTipGenerator providing the dateFormat You wish.

Regards,
Arnaud

Carrie

Re: When I use the mouse point to the bar, it shows USD/GBP:

Post by Carrie » Fri Feb 14, 2003 7:52 am

thx, but do you know how to disable tooltip which show while the mosue point to the bar?

Arnaud

Re: When I use the mouse point to the bar, it shows USD/GBP:

Post by Arnaud » Fri Feb 14, 2003 10:42 am

Hello,

Use the setToolTipGenerator method passing a null argument.

Regards,
Arnaud

Arnaud

Re: When I use the mouse point to the bar, it shows USD/GBP:

Post by Arnaud » Fri Feb 14, 2003 11:03 am

Hello,

Some code example :
1) using the constructor of createVerticalXYBarChart(String title,
String xAxisLabel,
String yAxisLabel,
IntervalXYDataset data,
boolean legend,
boolean tooltips,
boolean urls)
--> simply set tooltips value to false

2) if You already have a JFreeChart instance, let's say chart, You can write :
((XYPlot) chart.getPlot()).getRenderer().setToolTipGenerator(null);

Regards,
Arnaud

Carrie

Re: When I use the mouse point to the bar, it shows USD/GBP:

Post by Carrie » Mon Feb 17, 2003 4:30 am

Thanks a lot
It works now : )

Amit

Re: When I use the mouse point to the bar, it shows USD/GBP:

Post by Amit » Tue Feb 25, 2003 8:44 pm

In my case I have the tooltips set to true, but nothing shows up. Do I have to write any code for the tooltip to show ?

Thanks

David Gilbert

Re: When I use the mouse point to the bar, it shows USD/GBP:

Post by David Gilbert » Wed Feb 26, 2003 12:10 am

If you use the ChartFactory class to create your chart, and set the tooltips parameter to true, and display your chart in a ChartPanel, then the tooltips should appear. If that doesn't happen, there is a bug somewhere.

Regards,

Dave Gilbert

Amit

Re: When I use the mouse point to the bar, it shows USD/GBP:

Post by Amit » Wed Feb 26, 2003 2:50 pm

Found my mistake !!
I was trying to look for a tooltip in an image file !!
What is the easiest way of seeing a tooltip in a jsp ? I dont like to put too much code in JSPs

Thanks

Locked