Hi
I have a vertical pareto chart by using bar teechart object. If I want to see it as horizontal pareto chart, how can I do that? Is it possible to rotate the axis such that bottom axis become a left axis, and the left axis becomes a top axis?
horizontal pareto chart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: horizontal pareto chart
Hi Jonathan,
No, you should use HorizBar series instead of Bar series. Do the same you already do with Bar but using HorizBar.
Hope this helps!
No, you should use HorizBar series instead of Bar series. Do the same you already do with Bar but using HorizBar.
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 |
Instructions - How to post in this forum |
Re: horizontal pareto chart
Hi,
Yes, it helps. thanks for the help.
I have two more questions.
Question1)
When I use HorizBar, I noticed that x axis on the bottom by default. Is it possible to have it to the top axis instead?
Question2)
When I re-label on the left axis, it also replace the markers. How can I prevent it? I tried using the setLabels built-in function to replace the markers, but it also replaces the labels as well. The following is a sample.
Yes, it helps. thanks for the help.
I have two more questions.
Question1)
When I use HorizBar, I noticed that x axis on the bottom by default. Is it possible to have it to the top axis instead?
Question2)
When I re-label on the left axis, it also replace the markers. How can I prevent it? I tried using the setLabels built-in function to replace the markers, but it also replaces the labels as well. The following is a sample.
Code: Select all
package com.amd.ngeda.chart.teechart;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.steema.teechart.TChart;
import com.steema.teechart.drawing.Color;
import com.steema.teechart.styles.Bar;
import com.steema.teechart.styles.Box;
import com.steema.teechart.styles.HorizBar;
import com.steema.teechart.styles.Line;
import com.steema.teechart.styles.StringList;
public class JonathanTest {
/**
* @param args
*/
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
panel.setSize(600, 600);
TChart chart = new TChart();
panel.add(chart);
HorizBar b = new HorizBar(chart.getChart());
b.add(1, 0, "A");
b.add(2, 1, "B");
// StringList labelsList = new StringList(2);
// labelsList.add(0, "1");
// labelsList.add(1, "2");
// b.setLabels(labelsList);
frame.add(panel);
frame.setSize(600, 600);
frame.setVisible(true);
}
}
Re: horizontal pareto chart
Hi Jonathan,
You have two options:
- Change axis style to VALUE in example:
- Custom Labels: Clear and set the axis labels manually:
Yes, you can do it as follows:Jonathan wrote:Question1)
When I use HorizBar, I noticed that x axis on the bottom by default. Is it possible to have it to the top axis instead?
Code: Select all
b.setHorizontalAxis(HorizontalAxis.TOP);
If your series (b in your case) has values with texts/labels, the axis linked to it shows these texts by default. And changing the series strings affects both the series marks and the axis labels.Jonathan wrote:Question2)
When I re-label on the left axis, it also replace the markers. How can I prevent it? I tried using the setLabels built-in function to replace the markers, but it also replaces the labels as well. The following is a sample.
You have two options:
- Change axis style to VALUE in example:
Code: Select all
tChart1.getAxes().getLeft().getLabels().setStyle(AxisLabelStyle.VALUE);
Code: Select all
AxisLabelsItems LeftAxisLabels = tChart1.getAxes().getLeft().getLabels().getItems();
LeftAxisLabels.clear();
LeftAxisLabels.add(0.0, "1");
LeftAxisLabels.add(1.0, "2");
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: horizontal pareto chart
Hi Yeray,
Thanks for the help and answering my questions.
Thanks for the help and answering my questions.