Examples of GwtXAxisOptions


Examples of com.invient.vaadin.charts.widgetset.client.ui.GwtInvientChartsConfig.GwtXAxisOptions

        VConsole.log("Enter [getXAxisOptions]");
        VConsole.log("Tag Name : " + uidl.getTag());
        JsArray<GwtXAxisOptions> xAxes = JavaScriptObject.createArray().cast();

        for (int cnt = 0; cnt < uidl.getChildCount(); cnt++) {
            GwtXAxisOptions xAxisOptions = GwtXAxisOptions.create();
            UIDL axisUIDL = uidl.getChildUIDL(cnt);
            if (axisUIDL.getAttributeNames().size() == 0
                    && axisUIDL.getChildCount() == 0) {
                continue;
            }
            updateBaseAxisOptions(axisUIDL, xAxisOptions);

            UIDL childUIDL = axisUIDL.getChildUIDL(4);
            if (childUIDL != null) {
                if (childUIDL.getTag().equals("categories")
                        && childUIDL.getChildCount() > 0) {
                    JsArrayString categories = JavaScriptObject.createArray()
                            .cast();
                    UIDL categoriesUIDL = childUIDL;
                    for (int idx = 0; idx < categoriesUIDL.getChildCount(); idx++) {
                        categories.push(categoriesUIDL.getChildUIDL(idx)
                                .getStringAttribute("name"));
                    }
                    xAxisOptions.setCategories(categories);
                } else if (childUIDL.getTag().equals("dateTimeLabelFormats")
                        && childUIDL.getAttributeNames().size() > 0) {
                    UIDL dateTimeLblFmtsUIDL = childUIDL;
                    GwtDateTimeLabelFormats formats = GwtDateTimeLabelFormats
                            .create();
                    if (dateTimeLblFmtsUIDL.hasAttribute("second")) {
                        formats.setSecond(dateTimeLblFmtsUIDL
                                .getStringAttribute("second"));
                    }
                    if (dateTimeLblFmtsUIDL.hasAttribute("minute")) {
                        formats.setMinute(dateTimeLblFmtsUIDL
                                .getStringAttribute("minute"));
                    }
                    if (dateTimeLblFmtsUIDL.hasAttribute("hour")) {
                        formats.setHour(dateTimeLblFmtsUIDL
                                .getStringAttribute("hour"));
                    }
                    if (dateTimeLblFmtsUIDL.hasAttribute("day")) {
                        formats.setDay(dateTimeLblFmtsUIDL
                                .getStringAttribute("day"));
                    }
                    if (dateTimeLblFmtsUIDL.hasAttribute("week")) {
                        formats.setWeek(dateTimeLblFmtsUIDL
                                .getStringAttribute("week"));
                    }
                    if (dateTimeLblFmtsUIDL.hasAttribute("month")) {
                        formats.setMonth(dateTimeLblFmtsUIDL
                                .getStringAttribute("month"));
                    }
                    if (dateTimeLblFmtsUIDL.hasAttribute("year")) {
                        formats.setYear(dateTimeLblFmtsUIDL
                                .getStringAttribute("year"));
                    }
                    xAxisOptions.setDateTimeLabelFormats(formats);
                }
            }
            xAxes.push(xAxisOptions);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.