Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Java
  4. jfreechar tooltip not able to show

jfreechar tooltip not able to show

Scheduled Pinned Locked Moved Java
helpquestion
2 Posts 2 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 2321293
    wrote on last edited by
    #1

    I am generating barchart using jFreeChart and i need to make a customize content tooltip for the bar and here is my customized function on StandardCategoryToolTipGenerator and the problem right now is.. when mouse point to the bar the tooltip does not show

    class MyTooltipGenerator extends StandardCategoryToolTipGenerator
    {

    	@Override
    	public String generateToolTip(CategoryDataset dataset, int series, int category)
    	{
    		
    		return "generateToolTip";
    	}
    
    	@Override
    	public String generateLabelString(CategoryDataset dataset, int row, int col)
    	{
    		return dataset.getColumnKey(col) + " " + dataset.getValue(row, col);
    	}
    
    };
    

    Both StandardCategoryToolTipGenerator and BarRender are customized as below:

    MyTooltipGenerator std = new MyTooltipGenerator();
    BarRenderer renderer = new MyBarRenderer();

    when generating the content of the tooltip i make is as below:

            BarRenderer rr = (BarRenderer) plot.getRenderer();
    		std.**generateLabelString**(dataset, row, column);
    		std.**generateToolTip**(dataset, row, column);
    		rr.setBaseToolTipGenerator(std);
    		plot.setRenderer(rr);
    

    Problem now is the tooltip are NOT able to show.. is the tooltip required certain FORMAT? cause my plan is make the tooltip to be look like: Quaitity: 50 Percetage: 80% when the mouse point to the bar and it cannot display like above

    L 1 Reply Last reply
    0
    • M Member 2321293

      I am generating barchart using jFreeChart and i need to make a customize content tooltip for the bar and here is my customized function on StandardCategoryToolTipGenerator and the problem right now is.. when mouse point to the bar the tooltip does not show

      class MyTooltipGenerator extends StandardCategoryToolTipGenerator
      {

      	@Override
      	public String generateToolTip(CategoryDataset dataset, int series, int category)
      	{
      		
      		return "generateToolTip";
      	}
      
      	@Override
      	public String generateLabelString(CategoryDataset dataset, int row, int col)
      	{
      		return dataset.getColumnKey(col) + " " + dataset.getValue(row, col);
      	}
      
      };
      

      Both StandardCategoryToolTipGenerator and BarRender are customized as below:

      MyTooltipGenerator std = new MyTooltipGenerator();
      BarRenderer renderer = new MyBarRenderer();

      when generating the content of the tooltip i make is as below:

              BarRenderer rr = (BarRenderer) plot.getRenderer();
      		std.**generateLabelString**(dataset, row, column);
      		std.**generateToolTip**(dataset, row, column);
      		rr.setBaseToolTipGenerator(std);
      		plot.setRenderer(rr);
      

      Problem now is the tooltip are NOT able to show.. is the tooltip required certain FORMAT? cause my plan is make the tooltip to be look like: Quaitity: 50 Percetage: 80% when the mouse point to the bar and it cannot display like above

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Try the support forum at JFreeChart[^].

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups