Académique Documents
Professionnel Documents
Culture Documents
CICLO: III
SECCION: B
PIURA – 2017
Actividad de Responsabilidad Social.
Solución:
las horas de uso que se desee dar uso a una red social y luego al hacer clic en el
botón actualizar la gráfica se dividirá en partes según las horas que se le indique.
Imagen N º 02: Programa al ser ejecutado con la siguiente cantidad de horas por cada
package actividad_numero_11_rs;
import java.awt.BorderLayout;
import java.util.Set;
import javafx.application.Platform;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.embed.swing.JFXPanel;
import javafx.geometry.Side;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.chart.PieChart;
import javafx.scene.chart.PieChart.Data;
import javafx.scene.control.Label;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
/**
* @author Usuario
*/
/**
*/
*/
/**
* Grafico 2d
*/
/**
*/
public frm_grafica_del_tiempo_en_redes_sociales() {
initComponents();
setLocationRelativeTo(null);
//crea la escena
createScene();
jPanel1.setLayout(new BorderLayout());
jPanel1.add(jfxPanel,BorderLayout.CENTER);
Platform.runLater(() -> {
pieChart.setLegendSide(Side.LEFT);//Posicion de leyenda
pieChart.setData(getChartData());
updateColors();
jfxPanel.setScene(new Scene(pieChart));
});
return data2d;
/**
*/
Color.web("#3498DB"),Color.web("#8E44AD") };
int i = 0;
i++;
i = 0;
label.setGraphic(rectangle);
i++;
/**
*/
Platform.runLater(() -> {
data2d.clear();
updateColors();
});
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
*/
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
*/
Integer.valueOf(jSpinner1.getValue().toString()),Integer.valueOf(jSpinner2.getVal
ue().toString()),Integer.valueOf(jSpinner3.getValue().toString()),Integer.valueOf(j
Spinner4.getValue().toString()));