Search in sources :

Example 1 with BaseGoogleTrendChart

use of com.kyj.fx.voeditor.visual.component.chart.service.BaseGoogleTrendChart in project Gargoyle by callakrsos.

the class GoogleTrendExam method start.

/* (non-Javadoc)
	 * @see javafx.application.Application#start(javafx.stage.Stage)
	 */
@Override
public void start(Stage primaryStage) throws Exception {
    URL url = new URL(createUrl());
    String jsonString = RequestUtil.requestSSL(url, requestHandler);
    //		String source = ValueUtil.toString(GoogleTrendExam.class.getResourceAsStream("GoogleTrendSample.json"));
    BaseGoogleTrendChart root = new BaseGoogleTrendChart(jsonString, new CategoryAxis(), new NumberAxis(0, 100, 10));
    root.setVerticalGridLinesVisible(false);
    root.addEventFilter(GoogleTrendChartEvent.GOOGLE_CHART_INTERSECT_NODE_CLICK, ev -> {
        System.out.println(ev.getContents());
    });
    root.addEventHandler(GoogleTrendChartEvent.GOOGLE_CHART_INTERSECT_NODE_CLICK, ev -> {
        System.out.println(ev.getContents());
    });
    primaryStage.setScene(new Scene(root));
    primaryStage.show();
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) CategoryAxis(javafx.scene.chart.CategoryAxis) BaseGoogleTrendChart(com.kyj.fx.voeditor.visual.component.chart.service.BaseGoogleTrendChart) Scene(javafx.scene.Scene) URL(java.net.URL)

Aggregations

BaseGoogleTrendChart (com.kyj.fx.voeditor.visual.component.chart.service.BaseGoogleTrendChart)1 URL (java.net.URL)1 Scene (javafx.scene.Scene)1 CategoryAxis (javafx.scene.chart.CategoryAxis)1 NumberAxis (javafx.scene.chart.NumberAxis)1