Hi there,
Does anyone know to specify the target page when generating a URL in bar chart?
I am creating a bar chart with three bars, and I want to know how can I set a different url for each bar and how can set the target page i.e like in html where we set target="_blank" in order to open the url page in a new window?
Your help is very appreciated.
Thanks in advance.
How can I specify the target page???
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
You'll have to provide a custom implementation of the CategoryURLGenerator interface.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Surely CategoryURLGenerator only generates the URL itself?
The target is a seperate html attribute in the area tag. Looking at the code in ChartEntity it uses an implementation of the URLTagFragmentGenerator in getImageMapAreaTag() to generate the full html for the tags in the html area map.
The default impl as used by ImageMapUtilities is StandardURLTagFragmentGenerator which just has
You could instead provide your own impl that has
As you also need to implement CategoryURLGenerator to customise the URL contents like David mentioned you could have your class implement both interfaces.
hth
The target is a seperate html attribute in the area tag. Looking at the code in ChartEntity it uses an implementation of the URLTagFragmentGenerator in getImageMapAreaTag() to generate the full html for the tags in the html area map.
The default impl as used by ImageMapUtilities is StandardURLTagFragmentGenerator which just has
Code: Select all
public String generateURLFragment(String urlText) {
return " href=\"" + urlText + "\"";
}
Code: Select all
public String generateURLFragment(String urlText) {
return " href=\"" + urlText + "\" target=\"_blank\"";
}
hth
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
You are absolutely right...sorry for the misinformation.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


How can I specify the target page???
Thanks Guys,
I will try that.
Regards
Kamel A.
I will try that.
Regards
Kamel A.