Misc. Issues with java graphs

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

Misc. Issues with java graphs

Post by cathy » Tue Sep 09, 2008 10:59 pm

I have uploaded a winzip file - tosteema.zip which contains my java project and jpg images generated as well as corresponding images created using your active x teechart software using VB6. The readme.txt file in the zip file contains my questions as follows:

I need assistance with the following - see zip file uploaded to website - tosteema.zip

1. Referring to TestInitialAllocation.jpg:

This is generated with the following call from Teechart.java which can be run as an application (see main).

teeChartWrapper.createAllocationPieChartGraph(jpgFileName, initAllocation, fund, additionalLegendTitle);

In teeChartWrapper.java, I am trying to underline the last line of the annotation before placing the sum of all the numbers and these 2 lines do not work:

if( i == allocAmounts.length - 1) {
tools[toolCount].getShape().getFont().setUnderline(true);
}

See VBpiechart.bmp for desired look and feel

2. Referring to TestInitialAllocation.jpg - noting the slice of the pie chart referred to in the Legend as JNL/Eagle Core Equity (light blue) - how do I get rid of the
"crooked line" as well as smoothing out other borders. I've also attached VBpiechart.bmp - which is the graph created from teechart active x version.


3. When I execute all 3 of these lines from teechart.java
// teeChartWrapper.createAllocationPieChartGraph(jpgFileName, initAllocation, fund, additionalLegendTitle);
teeChartWrapper.createPointLineGraph(jpgFileName, indexLinkedValueSelInc, additionalBenValueInc, indexLinkedValueMinInc, minimumValueInc, pointLineGraphNames);
// teeChartWrapper.createStackedBarGraph(jpgFileName, indexLinkedValueSelInc, MonAveInc, PointtoPointInc, MonSumInc, stackedBarGraphNames);

only the first jpg file comes out OK, the 2nd and 3rd have "leftovers" from the previous graphs, what code is used to "clear the canvas"?
This project is a stand-alone project generating the types of graphs that will be generated dynamically within a web app whereby numerous graphs will be created and
imbedded in a final pdf.

4, Referring to teststackedbarFIA.jpg and VBstackedbar.jpg

a. How do I get rid of the thick black borders on the legend to look more like the VB legend
b. How do I get rid of the lines which seem to be connecting the bars at the top?
c. On the left axis - the "yellow wall" needs to be more the color of the VB left axis wall. How do I do this? In the VB code, it didn't appear that they were overriding
this wall shade?

Thanks

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

Post by Narcís » Wed Sep 10, 2008 12:54 pm

Hi cathy,
1. Referring to TestInitialAllocation.jpg:

This is generated with the following call from Teechart.java which can be run as an application (see main).

teeChartWrapper.createAllocationPieChartGraph(jpgFileName, initAllocation, fund, additionalLegendTitle);

In teeChartWrapper.java, I am trying to underline the last line of the annotation before placing the sum of all the numbers and these 2 lines do not work:

if( i == allocAmounts.length - 1) {
tools[toolCount].getShape().getFont().setUnderline(true);
}

See VBpiechart.bmp for desired look and feel
I could reproduce this and checked that setUnderline doesn't work for any TeeChart fonts. I've added this to the defect list (TJ71013392) to be fixed for next releases.
2. Referring to TestInitialAllocation.jpg - noting the slice of the pie chart referred to in the Legend as JNL/Eagle Core Equity (light blue) - how do I get rid of the
"crooked line" as well as smoothing out other borders. I've also attached VBpiechart.bmp - which is the graph created from teechart active x version.
We could reproduce this too. We will try to enhance this for next releases. Also notice that we are currently developing TeeChart for Java v2 and pie rendering has been enhanced and this problem doesn't occur in v2.
3. When I execute all 3 of these lines from teechart.java
// teeChartWrapper.createAllocationPieChartGraph(jpgFileName, initAllocation, fund, additionalLegendTitle);
teeChartWrapper.createPointLineGraph(jpgFileName, indexLinkedValueSelInc, additionalBenValueInc, indexLinkedValueMinInc, minimumValueInc, pointLineGraphNames);
// teeChartWrapper.createStackedBarGraph(jpgFileName, indexLinkedValueSelInc, MonAveInc, PointtoPointInc, MonSumInc, stackedBarGraphNames);

only the first jpg file comes out OK, the 2nd and 3rd have "leftovers" from the previous graphs, what code is used to "clear the canvas"?
This project is a stand-alone project generating the types of graphs that will be generated dynamically within a web app whereby numerous graphs will be created and
imbedded in a final pdf.
You can try running code below at the beginning of each method for clearing previous chart series, tools and custom painting.

Code: Select all

        myChart.removeAllSeries();
        myChart.getTools().clear();
        myChart.repaint();
        //or
        //myChart.refreshControl();
4, Referring to teststackedbarFIA.jpg and VBstackedbar.jpg

a. How do I get rid of the thick black borders on the legend to look more like the VB legend
Try this:

Code: Select all

        myChart.getLegend().getSymbol().getPen().setWidth(1);
b. How do I get rid of the lines which seem to be connecting the bars at the top?
This is because in createStackedBarGraph you are using a BarJoin series instead of a Bar series.
c. On the left axis - the "yellow wall" needs to be more the color of the VB left axis wall. How do I do this? In the VB code, it didn't appear that they were overriding this wall shade?
It's just that default colors are different. You can set wall's color like this:

Code: Select all

        myChart.getWalls().getLeft().setColor(Color.fromArgb(255, 255, 128));
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