In developing an application, I am plotting a graph as the end result of user data entries.
The main point is that, as I will present in the following code, I have a FOR that will plot each point based on the calculations already programmed. If I put the XYPLOT of the program inside the FOR, the graph exits correctly, however the legend presents 100 times each point plotted. (The FOR is divided into 100 points and each point has to be plotted on the chart). Now, if I put the plot code outside of FOR, the legend exits correctly, but the plot is not plotted.
Can anyone help ?! Thank you!
Plot code within FOR
deformacao_aco_compressao_variavel_dominio1 = 0.01;
for (i=0; i<100; i++){
Normal_dominio1 = this.Normal_Aco_Compressao_Dominio1() + this.Normal_Aco_Tracao_Dominio1();
Normal_vetor_dominio1[i] = Normal_dominio1;
Momento_dominio1 = this.Momento_Aco_Compressao_Dominio1() + this.Momento_Aco_Tracao_Dominio1();
Momento_vetor_dominio1[i] = Momento_dominio1;
// Código para plotar o gráfico
XYSeries dominio1 = new SimpleXYSeries(Arrays.asList(this.Normal_vetor_dominio1[i]), Arrays.asList(this.Momento_vetor_dominio1[i]), "D.1");
LineAndPointFormatter dominio1Format = new LineAndPointFormatter(Color.GREEN, Color.GREEN, Color.GREEN, null);
graph.addSeries(dominio1, dominio1Format);
deformacao_aco_compressao_variavel_dominio1 = deformacao_aco_compressao_variavel_dominio1 - (0.01 - this.Deformacao_Aco_Compressao_Dominio1()) / 100;
}
How do you get the plot code inside the FOR
HowdoyougettheplotcodeoutsideofFOR