Hello,
my code looks like:
TChar tchart2 = new TChart();
tchart2.addSeries(new Bar());
tchar2.getSeries(0).add(10);
tchart2.addSeries(new Bar());
tchar2.getSeries(1).add(18);
tchart2.addSeries(new Bar());
tchar2.getSeries(2).add(30);
Finally, only the first series is showed.
That is, only one bar is showed. There must be three bars.
Does anyone know how to address this?
Thanks.
Problem with Bar
Re: Problem with Bar
my code is as follows.
In the bar.png, you will find there is only one bar which is wrong.
In the bar.png, you will find there is only one bar which is wrong.
Code: Select all
import com.steema.teechart.Dimension;
import com.steema.teechart.Rectangle;
import com.steema.teechart.TChart;
import com.steema.teechart.editors.ChartEditor;
import com.steema.teechart.styles.Bar;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JDialog;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
/**
*
* @author
*/
public class TestTeeChartJunit extends JDialog {
public TestTeeChartJunit() {
this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
setSize(new Dimension(581, 380));
setTitle("TeeChart for Java - Swing example application");
tChart2 = new TChart();
tChart2.setGraphics3D(null);
// tChart2.addSeries(new Line());
// tChart2.getSeries(0).fillSampleValues(); //随机数
tChart2.addSeries(new Bar());
tChart2.getSeries(0).add(10);
tChart2.addSeries(new Bar());
tChart2.getSeries(1).add(13);
tChart2.addSeries(new Bar());
tChart2.getSeries(2).add(49);
tChart2.addSeries(new Bar());
tChart2.getSeries(3).add(55);
tChart2.setBounds(new Rectangle(0, 0, 500, 500));
//设置图标的属性
tChart2.getAspect().setView3D(false); // no 3D
// tChart2.getLegend().setText("jw legend");
this.add(tChart2);
tChart2.setComponentPopupMenu(popup);
JMenuItem item = new JMenuItem("Property");
item.addActionListener(new RightListener(tChart2));
popup.add(item);
this.setVisible(true);
}
public static void main(String[] args) {
TestTeeChartJunit myChart = new TestTeeChartJunit();
}
TChart tChart2;
JPopupMenu popup = new JPopupMenu();
}
class RightListener implements ActionListener {
TChart tChart2 = null;
public RightListener(TChart chart) {
this.tChart2 = chart;
}
public void actionPerformed(ActionEvent e) {
ChartEditor.editChart(tChart2.getChart());
}
}
- Attachments
-
- bar.png (13.47 KiB) Viewed 12514 times
Re: Problem with Bar
Hi,
That's a problem already present in the defect list to be fixed for further releases (TJ71016295).
I've incremented the ticket priority.
That's a problem already present in the defect list to be fixed for further releases (TJ71016295).
I've incremented the ticket priority.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Problem with Bar
hello,
I find an approach to avoid this problem by
does there exists some other approaches to avoid this problem?
e.g. set bigger distance between each bar? or something else?
I find an approach to avoid this problem by
Code: Select all
chart.getAspect().setView3D(true)
e.g. set bigger distance between each bar? or something else?
Re: Problem with Bar
Hello,
luckily, i find a perfect approach to avoid the bar problem which is very common and confuse the users always.
luckily, i find a perfect approach to avoid the bar problem which is very common and confuse the users always.
Code: Select all
(Bar)chart.getSeries(i).setMultiBar(MultiBars.SIDEALL)