Package org.sgx.yuigwt.yui.charts

Examples of org.sgx.yuigwt.yui.charts.CartesianChartConfig


    
    //a general legend configuration to use in all our charts.
    ChartLegendConfig legendConfig1 = ChartLegendConfig.create();
   
    //a first cartesian chart.
    CartesianChartConfig chartConfig = CartesianChartConfig.create().cast();
    chartConfig.categoryKey("date");
    chartConfig.dataProvider(data1);
    chartConfig.render("#chart1");
    chartConfig.legend(legendConfig1);
    chartConfig.axe("category", AxisConfig.create().
      keys(new String[]{"date"}).
      styles(AxisStyle.create().
        label(AxisStyle.Label.create().rotation(45).fontSize("9px"))
      ).
      type("category")
    );
    CartesianChart chart1 = Y.newChart(chartConfig).cast();

    chart1.boundingBox().getNode("parentNode").getNode("parentNode").
      append("<p>a default chart with custom axes</p>");
   
    //now a second chart of type columns and a custom legend style. use the same config object
    chartConfig.type(ChartBase.TYPE_COLUMN);
    chartConfig.render("#chart2");
    chartConfig.legend(ChartLegendConfig.create().position("left"));
    CartesianChart chart2 = Y.newChart(chartConfig).cast().cast();
    chart2.boundingBox().getNode("parentNode").getNode("parentNode").
      append("<p>A <b>column</b> chart with custom axes and legend style</p>");
   
    //now the same chart of type bar and custom bar colors
    chartConfig.type(ChartBase.TYPE_BAR);
    chartConfig.render("#chart3");
    chartConfig.legend(ChartLegendConfig.create().position("bottom"));
    chartConfig.seriesCollection(new CartesianSeries[]{
//      CartesianSeries.C
    });
    CartesianChart chart3 = Y.newChart(chartConfig).cast().cast();
    chart3.boundingBox().getNode("parentNode").getNode("parentNode").
      append("<p>the same as before but type <b>bar</b> and bottom legend and and custom bar colors.</p>");
   
    chartConfig.type(ChartBase.TYPE_MARKERSERIES);
    chartConfig.render("#chart4");
    chartConfig.legend(ChartLegendConfig.create().position("bottom"));
    CartesianChart chart4 = Y.newChart(chartConfig).cast().cast();
    chart4.boundingBox().getNode("parentNode").getNode("parentNode").
      append("<p>the same as before but type <b>markseries</b></p>");
   
  }
View Full Code Here


    //a general legend configuration to use in all our charts.
    ChartLegendConfig legendConfig1 = ChartLegendConfig.create();
   
    //use a table to position charts.
    JsObject axes = JsObject.one("percentage", AxisConfig.create().axisType("numeric"));
    CartesianChartConfig chartConfig = CartesianChartConfig.create().cast();
    chartConfig.categoryKey("date");
    chartConfig.dataProvider(data1);
    chartConfig.render("#chart1");
    chartConfig.legend(legendConfig1);
    chartConfig.axe("category", AxisConfig.create().
      keys(new String[]{"date"}).
      styles(AxisStyle.create().
        label(AxisStyle.Label.create().rotation(45).fontSize("9px"))
      ).
      type("category")
View Full Code Here

TOP

Related Classes of org.sgx.yuigwt.yui.charts.CartesianChartConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.