Marks not visible in special cases

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Chen
Newbie
Newbie
Posts: 43
Joined: Tue Mar 11, 2008 12:00 am
Contact:

Marks not visible in special cases

Post by Chen » Fri Nov 14, 2008 11:23 pm

Hi,

In some cases Marks are not visible for CustomBar.

Code: Select all

import javax.swing.JFrame;
import javax.swing.JPanel;

import com.steema.teechart.TChart;
import com.steema.teechart.styles.Bar;
import com.steema.teechart.styles.CustomBar;

public class Test {

   public static void main(String[] args) {
      JFrame frame = new JFrame();
      JPanel panel = new JPanel();
      panel.setSize(600, 600);
      TChart chart = new TChart();
      chart.getAxes().getLeft().getTitle().setText("Help Needed");
      chart.getAxes().getLeft().setMinMax(0,50);
      panel.add(chart);
      CustomBar pareto = new Bar(chart.getChart());
      pareto.add(50, "a");
      pareto.add(50, "b");
      pareto.add(50, "c");
      chart.getChart().getTitle().setText("");
      frame.add(panel);
      frame.setSize(600, 600);
      frame.setVisible(true);
   }
} 
In this code I am setting left axis min and max to 0 and 50 respectively.
If you run the code then you can see that Marks are not visible.
This is a special case where the chart title is empty and axis max == max value for a CustomBar. Is there anyway I could display Marks on the bar itself? Or how can I make it visible at least?

Thanks,
Varun

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Nov 17, 2008 10:07 am

Hi Varun,

Yes, this is because of the settings you used for left axis scale.

An option is setting marks ArrowLength to zero or a negative value, for example:

Code: Select all

        pareto.getMarks().setArrowLength(-5);
Another one is setting left axis maximum offset, for example:

Code: Select all

        chart.getAxes().getLeft().setMaximumOffset(50);
Last option I can think of would be setting custom marks positions as shown on this thread. This is a TeeChart for .NET thread but the same applies to the Java version.

Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply