Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple chart is not rendered #23

Open
thombergs opened this issue Apr 21, 2014 · 0 comments
Open

simple chart is not rendered #23

thombergs opened this issue Apr 21, 2014 · 0 comments

Comments

@thombergs
Copy link
Member

Reported by venkataramireddy1508, Nov 27, 2013
What steps will reproduce the problem?
1.followed the steps in gettingStarted page
2.
3.

What is the expected output? What do you see instead?
charts are not rendered

What version of the product are you using? On what operating system?
latest version wicket 6.x , on fedora

Please provide any additional information below.
I added this code in homepage.java constructor.

Options chartOptions = new Options();
    chartOptions.setChartOptions(new ChartOptions().setType(SeriesType.LINE)
                                                    .setMarginRight(130)    
                                                    .setMarginBottom(25));

    chartOptions.setTitle(new Title("Monthly Average Temperature").setX(-20));

    chartOptions.setSubtitle(new Title("Source: WorldClimate.com").setX(-20));

    Axis xAxis = new Axis();
    xAxis
        .setCategories(Arrays
            .asList(new String[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
                "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }));
    chartOptions.setxAxis(xAxis);

    PlotLine plotLines = new PlotLine();
    plotLines
        .setValue(0f);
    plotLines
        .setWidth(1);
    plotLines
        .setColor(new HexColor("#999999"));

    Axis yAxis = new Axis();
    yAxis
        .setTitle(new Title("Temperature (��C)"));
    yAxis
        .setPlotLines(Collections
            .singletonList(plotLines));
    chartOptions.setyAxis(yAxis);

    Legend legend = new Legend();
    legend
        .setLayout(LegendLayout.VERTICAL);
    legend
        .setAlign(HorizontalAlignment.RIGHT);
    legend
        .setVerticalAlign(VerticalAlignment.TOP);
    legend
        .setX(-10);
    legend
        .setY(100);
    legend
        .setBorderWidth(0);
    chartOptions.setLegend(legend);

    Series<Number> series1 = new SimpleSeries();
    series1
        .setName("Tokyo");
    series1
        .setData(Arrays
            .asList(new Number[] { 7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5,
                23.3, 18.3, 13.9, 9.6 }));
    chartOptions.addSeries(series1);

    Series<Number> series2 = new SimpleSeries();
    series2
        .setName("New York");
    series2
        .setData(Arrays
            .asList(new Number[] { -0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8,
                24.1, 20.1, 14.1, 8.6, 2.5 }));
    chartOptions.addSeries(series2);

    Series<Number> series3 = new SimpleSeries();
    series3
        .setName("Berlin");
    series3
        .setData(Arrays
            .asList(new Number[] { -0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9,
                14.3, 9.0, 3.9, 1.0 }));
    chartOptions.addSeries(series3);

    Series<Number> series4 = new SimpleSeries();
    series4
        .setName("London");
    series4
        .setData(Arrays
            .asList(new Number[] { 3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6,
                14.2, 10.3, 6.6, 4.8 }));
    chartOptions.addSeries(series4);


        System.out.println("Options: " + chartOptions);
    add(new Chart("chart", chartOptions));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants