Search in sources :

Example 6 with JsFunction

use of io.jmix.charts.model.JsFunction in project jmix by jmix-framework.

the class ChartModelLoader method loadValueAxis.

protected ValueAxis loadValueAxis(Element valueAxisElement) {
    ValueAxis axis = new ValueAxis();
    loadAbstractAxis(axis, valueAxisElement);
    String id = valueAxisElement.attributeValue("id");
    if (StringUtils.isNotEmpty(id)) {
        axis.setId(id);
    }
    String labelFunction = valueAxisElement.elementText("labelFunction");
    if (StringUtils.isNotBlank(labelFunction)) {
        axis.setLabelFunction(new JsFunction(labelFunction));
    }
    String axisFrequency = valueAxisElement.attributeValue("axisFrequency");
    if (StringUtils.isNotEmpty(axisFrequency)) {
        axis.setAxisFrequency(Double.valueOf(axisFrequency));
    }
    String axisTitleOffset = valueAxisElement.attributeValue("axisTitleOffset");
    if (StringUtils.isNotEmpty(axisTitleOffset)) {
        axis.setAxisTitleOffset(Integer.valueOf(axisTitleOffset));
    }
    String balloonTextFunction = valueAxisElement.elementText("balloonTextFunction");
    if (StringUtils.isNotBlank(balloonTextFunction)) {
        axis.setBalloonTextFunction(new JsFunction(balloonTextFunction));
    }
    String baseValue = valueAxisElement.attributeValue("baseValue");
    if (StringUtils.isNotEmpty(baseValue)) {
        axis.setBaseValue(Double.valueOf(baseValue));
    }
    String duration = valueAxisElement.attributeValue("duration");
    if (StringUtils.isNotEmpty(duration)) {
        axis.setDuration(Duration.valueOf(duration));
    }
    String gridType = valueAxisElement.attributeValue("gridType");
    if (StringUtils.isNotEmpty(gridType)) {
        axis.setGridType(GridType.valueOf(gridType));
    }
    String includeAllValues = valueAxisElement.attributeValue("includeAllValues");
    if (StringUtils.isNotEmpty(includeAllValues)) {
        axis.setIncludeAllValues(Boolean.valueOf(includeAllValues));
    }
    String includeGuidesInMinMax = valueAxisElement.attributeValue("includeGuidesInMinMax");
    if (StringUtils.isNotEmpty(includeGuidesInMinMax)) {
        axis.setIncludeGuidesInMinMax(Boolean.valueOf(includeGuidesInMinMax));
    }
    String includeHidden = valueAxisElement.attributeValue("includeHidden");
    if (StringUtils.isNotEmpty(includeHidden)) {
        axis.setIncludeHidden(Boolean.valueOf(includeHidden));
    }
    String integersOnly = valueAxisElement.attributeValue("integersOnly");
    if (StringUtils.isNotEmpty(integersOnly)) {
        axis.setIntegersOnly(Boolean.valueOf(integersOnly));
    }
    String logarithmic = valueAxisElement.attributeValue("logarithmic");
    if (StringUtils.isNotEmpty(logarithmic)) {
        axis.setLogarithmic(Boolean.valueOf(logarithmic));
    }
    String maximum = valueAxisElement.attributeValue("maximum");
    if (StringUtils.isNotEmpty(maximum)) {
        axis.setMaximum(Double.valueOf(maximum));
    }
    String maximumDate = valueAxisElement.attributeValue("maximumDate");
    if (StringUtils.isNotEmpty(maximumDate)) {
        axis.setMaximumDate(loadDate(maximumDate));
    }
    String minimum = valueAxisElement.attributeValue("minimum");
    if (StringUtils.isNotEmpty(minimum)) {
        axis.setMinimum(Double.valueOf(minimum));
    }
    String minimumDate = valueAxisElement.attributeValue("minimumDate");
    if (StringUtils.isNotEmpty(minimumDate)) {
        axis.setMinimumDate(loadDate(minimumDate));
    }
    String minMaxMultiplier = valueAxisElement.attributeValue("minMaxMultiplier");
    if (StringUtils.isNotEmpty(minMaxMultiplier)) {
        axis.setMinMaxMultiplier(Double.valueOf(minMaxMultiplier));
    }
    String pointPosition = valueAxisElement.attributeValue("pointPosition");
    if (StringUtils.isNotEmpty(pointPosition)) {
        axis.setPointPosition(PointPosition.valueOf(pointPosition));
    }
    String precision = valueAxisElement.attributeValue("precision");
    if (StringUtils.isNotEmpty(precision)) {
        axis.setPrecision(Integer.valueOf(precision));
    }
    String radarCategoriesEnabled = valueAxisElement.attributeValue("radarCategoriesEnabled");
    if (StringUtils.isNotEmpty(radarCategoriesEnabled)) {
        axis.setRadarCategoriesEnabled(Boolean.valueOf(radarCategoriesEnabled));
    }
    String recalculateToPercents = valueAxisElement.attributeValue("recalculateToPercents");
    if (StringUtils.isNotEmpty(recalculateToPercents)) {
        axis.setRecalculateToPercents(Boolean.valueOf(recalculateToPercents));
    }
    String reversed = valueAxisElement.attributeValue("reversed");
    if (StringUtils.isNotEmpty(reversed)) {
        axis.setReversed(Boolean.valueOf(reversed));
    }
    String stackType = valueAxisElement.attributeValue("stackType");
    if (StringUtils.isNotEmpty(stackType)) {
        axis.setStackType(StackType.valueOf(stackType));
    }
    String strictMinMax = valueAxisElement.attributeValue("strictMinMax");
    if (StringUtils.isNotEmpty(strictMinMax)) {
        axis.setStrictMinMax(Boolean.valueOf(strictMinMax));
    }
    String synchronizationMultiplier = valueAxisElement.attributeValue("synchronizationMultiplier");
    if (StringUtils.isNotEmpty(synchronizationMultiplier)) {
        axis.setSynchronizationMultiplier(Double.valueOf(synchronizationMultiplier));
    }
    String synchronizeWith = valueAxisElement.attributeValue("synchronizeWith");
    if (StringUtils.isNotEmpty(synchronizeWith)) {
        axis.setSynchronizeWith(synchronizeWith);
    }
    String totalText = valueAxisElement.attributeValue("totalText");
    if (StringUtils.isNotEmpty(totalText)) {
        axis.setTotalText(loadResourceString(totalText));
    }
    String totalTextColor = valueAxisElement.attributeValue("totalTextColor");
    if (StringUtils.isNotEmpty(totalTextColor)) {
        axis.setTotalTextColor(Color.valueOf(totalTextColor));
    }
    String totalTextOffset = valueAxisElement.attributeValue("totalTextOffset");
    if (StringUtils.isNotEmpty(totalTextOffset)) {
        axis.setTotalTextOffset(Integer.valueOf(totalTextOffset));
    }
    String treatZeroAs = valueAxisElement.attributeValue("treatZeroAs");
    if (StringUtils.isNotEmpty(treatZeroAs)) {
        axis.setTreatZeroAs(Double.valueOf(treatZeroAs));
    }
    String type = valueAxisElement.attributeValue("type");
    if (StringUtils.isNotEmpty(type)) {
        axis.setType(ValueAxisType.valueOf(type));
    }
    String unit = valueAxisElement.attributeValue("unit");
    if (StringUtils.isNotEmpty(unit)) {
        axis.setUnit(unit);
    }
    String unitPosition = valueAxisElement.attributeValue("unitPosition");
    if (StringUtils.isNotEmpty(unitPosition)) {
        axis.setUnitPosition(UnitPosition.valueOf(unitPosition));
    }
    String usePrefixes = valueAxisElement.attributeValue("usePrefixes");
    if (StringUtils.isNotEmpty(usePrefixes)) {
        axis.setUsePrefixes(Boolean.valueOf(usePrefixes));
    }
    String useScientificNotation = valueAxisElement.attributeValue("useScientificNotation");
    if (StringUtils.isNotEmpty(useScientificNotation)) {
        axis.setUseScientificNotation(Boolean.valueOf(useScientificNotation));
    }
    String zeroGridAlpha = valueAxisElement.attributeValue("zeroGridAlpha");
    if (StringUtils.isNotEmpty(zeroGridAlpha)) {
        axis.setZeroGridAlpha(Double.valueOf(zeroGridAlpha));
    }
    String autoWrap = valueAxisElement.attributeValue("autoWrap");
    if (StringUtils.isNotEmpty(autoWrap)) {
        axis.setAutoWrap(Boolean.valueOf(autoWrap));
    }
    String minPeriod = valueAxisElement.attributeValue("minPeriod");
    if (StringUtils.isNotEmpty(minPeriod)) {
        DatePeriod dp = DatePeriod.fromId(minPeriod);
        if (dp == null) {
            dp = DatePeriod.valueOf(minPeriod);
        }
        axis.setMinPeriod(dp);
    }
    return axis;
}
Also used : JsFunction(io.jmix.charts.model.JsFunction) DatePeriod(io.jmix.charts.model.date.DatePeriod)

Example 7 with JsFunction

use of io.jmix.charts.model.JsFunction in project jmix by jmix-framework.

the class ChartModelLoader method loadLegend.

protected void loadLegend(AbstractLegend legend, Element legendElement) {
    loadLegendItems(legend, legendElement);
    String accessibleLabel = legendElement.attributeValue("accessibleLabel");
    if (StringUtils.isNotEmpty(accessibleLabel)) {
        legend.setAccessibleLabel(loadResourceString(accessibleLabel));
    }
    String align = legendElement.attributeValue("align");
    if (StringUtils.isNotEmpty(align)) {
        legend.setAlign(Align.valueOf(align));
    }
    String autoMargins = legendElement.attributeValue("autoMargins");
    if (StringUtils.isNotEmpty(autoMargins)) {
        legend.setAutoMargins(Boolean.valueOf(autoMargins));
    }
    String backgroundAlpha = legendElement.attributeValue("backgroundAlpha");
    if (StringUtils.isNotEmpty(backgroundAlpha)) {
        legend.setBackgroundAlpha(Double.valueOf(backgroundAlpha));
    }
    String backgroundColor = legendElement.attributeValue("backgroundColor");
    if (StringUtils.isNotEmpty(backgroundColor)) {
        legend.setBackgroundColor(Color.valueOf(backgroundColor));
    }
    String borderAlpha = legendElement.attributeValue("borderAlpha");
    if (StringUtils.isNotEmpty(borderAlpha)) {
        legend.setBorderAlpha(Double.valueOf(borderAlpha));
    }
    String borderColor = legendElement.attributeValue("borderColor");
    if (StringUtils.isNotEmpty(borderColor)) {
        legend.setBackgroundColor(Color.valueOf(borderColor));
    }
    String bottom = legendElement.attributeValue("bottom");
    if (StringUtils.isNotEmpty(bottom)) {
        legend.setBottom(Integer.parseInt(bottom));
    }
    String color = legendElement.attributeValue("color");
    if (StringUtils.isNotEmpty(color)) {
        legend.setColor(Color.valueOf(color));
    }
    String divId = legendElement.attributeValue("divId");
    if (StringUtils.isNotEmpty(divId)) {
        legend.setDivId(divId);
    }
    String enabled = legendElement.attributeValue("enabled");
    if (StringUtils.isNotEmpty(enabled)) {
        legend.setEnabled(Boolean.valueOf(enabled));
    }
    String equalWidths = legendElement.attributeValue("equalWidths");
    if (StringUtils.isNotEmpty(equalWidths)) {
        legend.setEqualWidths(Boolean.valueOf(equalWidths));
    }
    String fontSize = legendElement.attributeValue("fontSize");
    if (StringUtils.isNotEmpty(fontSize)) {
        legend.setFontSize(Integer.parseInt(fontSize));
    }
    String forceWidth = legendElement.attributeValue("forceWidth");
    if (StringUtils.isNotEmpty(forceWidth)) {
        legend.setForceWidth(Boolean.valueOf(forceWidth));
    }
    String gradientRotation = legendElement.attributeValue("gradientRotation");
    if (StringUtils.isNotEmpty(gradientRotation)) {
        legend.setGradientRotation(Integer.parseInt(gradientRotation));
    }
    String horizontalGap = legendElement.attributeValue("horizontalGap");
    if (StringUtils.isNotEmpty(horizontalGap)) {
        legend.setHorizontalGap(Integer.parseInt(horizontalGap));
    }
    String labelWidth = legendElement.attributeValue("labelWidth");
    if (StringUtils.isNotEmpty(labelWidth)) {
        legend.setLabelWidth(Integer.parseInt(labelWidth));
    }
    String labelText = legendElement.attributeValue("labelText");
    if (StringUtils.isNotEmpty(labelText)) {
        legend.setLabelText(loadResourceString(labelText));
    }
    String left = legendElement.attributeValue("left");
    if (StringUtils.isNotEmpty(left)) {
        legend.setLeft(Integer.parseInt(left));
    }
    loadMargins(legend, legendElement);
    String markerBorderAlpha = legendElement.attributeValue("markerBorderAlpha");
    if (StringUtils.isNotEmpty(markerBorderAlpha)) {
        legend.setMarkerBorderAlpha(Double.valueOf(markerBorderAlpha));
    }
    String markerBorderColor = legendElement.attributeValue("markerBorderColor");
    if (StringUtils.isNotEmpty(markerBorderColor)) {
        legend.setMarkerBorderColor(Color.valueOf(markerBorderColor));
    }
    String markerBorderThickness = legendElement.attributeValue("markerBorderThickness");
    if (StringUtils.isNotEmpty(markerBorderThickness)) {
        legend.setMarkerBorderThickness(Integer.parseInt(markerBorderThickness));
    }
    String markerDisabledColor = legendElement.attributeValue("markerDisabledColor");
    if (StringUtils.isNotEmpty(markerDisabledColor)) {
        legend.setMarkerDisabledColor(Color.valueOf(markerDisabledColor));
    }
    String markerLabelGap = legendElement.attributeValue("markerLabelGap");
    if (StringUtils.isNotEmpty(markerLabelGap)) {
        legend.setMarkerLabelGap(Integer.parseInt(markerLabelGap));
    }
    String markerSize = legendElement.attributeValue("markerSize");
    if (StringUtils.isNotEmpty(markerSize)) {
        legend.setMarkerSize(Integer.parseInt(markerSize));
    }
    String markerType = legendElement.attributeValue("markerType");
    if (StringUtils.isNotEmpty(markerType)) {
        legend.setMarkerType(MarkerType.valueOf(markerType));
    }
    String maxColumns = legendElement.attributeValue("maxColumns");
    if (StringUtils.isNotEmpty(maxColumns)) {
        legend.setMaxColumns(Integer.parseInt(maxColumns));
    }
    String periodValueText = legendElement.attributeValue("periodValueText");
    if (StringUtils.isNotEmpty(periodValueText)) {
        legend.setPeriodValueText(loadResourceString(periodValueText));
    }
    String position = legendElement.attributeValue("position");
    if (StringUtils.isNotEmpty(position)) {
        legend.setPosition(LegendPosition.valueOf(position));
    }
    String reversedOrder = legendElement.attributeValue("reversedOrder");
    if (StringUtils.isNotEmpty(reversedOrder)) {
        legend.setReversedOrder(Boolean.valueOf(reversedOrder));
    }
    String right = legendElement.attributeValue("right");
    if (StringUtils.isNotEmpty(right)) {
        legend.setRight(Integer.parseInt(right));
    }
    String rollOverColor = legendElement.attributeValue("rollOverColor");
    if (StringUtils.isNotEmpty(rollOverColor)) {
        legend.setRollOverColor(Color.valueOf(rollOverColor));
    }
    String rollOverGraphAlpha = legendElement.attributeValue("rollOverGraphAlpha");
    if (StringUtils.isNotEmpty(rollOverGraphAlpha)) {
        legend.setRollOverGraphAlpha(Double.valueOf(rollOverGraphAlpha));
    }
    String showEntries = legendElement.attributeValue("showEntries");
    if (StringUtils.isNotEmpty(showEntries)) {
        legend.setShowEntries(Boolean.valueOf(showEntries));
    }
    String spacing = legendElement.attributeValue("spacing");
    if (StringUtils.isNotEmpty(spacing)) {
        legend.setSpacing(Integer.parseInt(spacing));
    }
    String switchable = legendElement.attributeValue("switchable");
    if (StringUtils.isNotEmpty(switchable)) {
        legend.setSwitchable(Boolean.valueOf(switchable));
    }
    String switchColor = legendElement.attributeValue("switchColor");
    if (StringUtils.isNotEmpty(switchColor)) {
        legend.setSwitchColor(Color.valueOf(switchColor));
    }
    String switchType = legendElement.attributeValue("switchType");
    if (StringUtils.isNotEmpty(switchType)) {
        legend.setSwitchType(LegendSwitch.valueOf(switchType));
    }
    String textClickEnabled = legendElement.attributeValue("textClickEnabled");
    if (StringUtils.isNotEmpty(textClickEnabled)) {
        legend.setTextClickEnabled(Boolean.valueOf(textClickEnabled));
    }
    String tabIndex = legendElement.attributeValue("tabIndex");
    if (StringUtils.isNotEmpty(tabIndex)) {
        legend.setTabIndex(Integer.parseInt(tabIndex));
    }
    String top = legendElement.attributeValue("top");
    if (StringUtils.isNotEmpty(top)) {
        legend.setTop(Integer.parseInt(top));
    }
    String useGraphSettings = legendElement.attributeValue("useGraphSettings");
    if (StringUtils.isNotEmpty(useGraphSettings)) {
        legend.setUseGraphSettings(Boolean.valueOf(useGraphSettings));
    }
    String useMarkerColorForLabels = legendElement.attributeValue("useMarkerColorForLabels");
    if (StringUtils.isNotEmpty(useMarkerColorForLabels)) {
        legend.setUseMarkerColorForLabels(Boolean.valueOf(useMarkerColorForLabels));
    }
    String useMarkerColorForValues = legendElement.attributeValue("useMarkerColorForValues");
    if (StringUtils.isNotEmpty(useMarkerColorForValues)) {
        legend.setUseMarkerColorForValues(Boolean.valueOf(useMarkerColorForValues));
    }
    String valueAlign = legendElement.attributeValue("valueAlign");
    if (StringUtils.isNotEmpty(valueAlign)) {
        legend.setValueAlign(ValueAlign.valueOf(valueAlign));
    }
    String valueFunction = legendElement.elementText("valueFunction");
    if (StringUtils.isNotBlank(valueFunction)) {
        legend.setValueFunction(new JsFunction(valueFunction));
    }
    String valueText = legendElement.attributeValue("valueText");
    if (StringUtils.isNotEmpty(valueText)) {
        legend.setValueText(loadResourceString(valueText));
    }
    String valueWidth = legendElement.attributeValue("valueWidth");
    if (StringUtils.isNotEmpty(valueWidth)) {
        legend.setValueWidth(Integer.parseInt(valueWidth));
    }
    String verticalGap = legendElement.attributeValue("verticalGap");
    if (StringUtils.isNotEmpty(verticalGap)) {
        legend.setVerticalGap(Integer.parseInt(verticalGap));
    }
    String width = legendElement.attributeValue("width");
    if (StringUtils.isNotEmpty(width)) {
        legend.setWidth(Integer.parseInt(width));
    }
    String combineLegend = legendElement.attributeValue("combineLegend");
    if (StringUtils.isNotEmpty(combineLegend)) {
        legend.setCombineLegend(Boolean.valueOf(combineLegend));
    }
}
Also used : JsFunction(io.jmix.charts.model.JsFunction)

Example 8 with JsFunction

use of io.jmix.charts.model.JsFunction in project jmix by jmix-framework.

the class ChartModelLoader method loadValueAxes.

protected void loadValueAxes(CoordinateChartModel chart, Element element) {
    Element valueAxesElement = element.element("valueAxes");
    if (valueAxesElement != null) {
        for (Object axisItem : valueAxesElement.elements("axis")) {
            Element axisElement = (Element) axisItem;
            ValueAxis axis = loadValueAxis(axisElement);
            String labelFunction = valueAxesElement.elementText("labelFunction");
            if (StringUtils.isNotBlank(labelFunction)) {
                axis.setLabelFunction(new JsFunction(labelFunction));
            }
            chart.addValueAxes(axis);
        }
    }
}
Also used : JsFunction(io.jmix.charts.model.JsFunction) Element(org.dom4j.Element)

Example 9 with JsFunction

use of io.jmix.charts.model.JsFunction in project jmix by jmix-framework.

the class ChartModelLoader method loadCursor.

protected void loadCursor(RectangularChartModel chart, Element element) {
    Element cursorElement = element.element("chartCursor");
    if (cursorElement != null) {
        Cursor cursor = new Cursor();
        String adjustment = cursorElement.attributeValue("adjustment");
        if (StringUtils.isNotEmpty(adjustment)) {
            cursor.setAdjustment(Integer.valueOf(adjustment));
        }
        String categoryBalloonFunction = cursorElement.elementText("categoryBalloonFunction");
        if (StringUtils.isNotEmpty(categoryBalloonFunction)) {
            cursor.setCategoryBalloonFunction(new JsFunction(categoryBalloonFunction));
        }
        String animationDuration = cursorElement.attributeValue("animationDuration");
        if (StringUtils.isNotEmpty(animationDuration)) {
            cursor.setAnimationDuration(Double.valueOf(animationDuration));
        }
        String avoidBalloonOverlapping = cursorElement.attributeValue("avoidBalloonOverlapping");
        if (StringUtils.isNotEmpty(avoidBalloonOverlapping)) {
            cursor.setAvoidBalloonOverlapping(Boolean.valueOf(avoidBalloonOverlapping));
        }
        String balloonPointerOrientation = cursorElement.attributeValue("balloonPointerOrientation");
        if (StringUtils.isNotEmpty(balloonPointerOrientation)) {
            cursor.setBalloonPointerOrientation(balloonPointerOrientation);
        }
        String bulletsEnabled = cursorElement.attributeValue("bulletsEnabled");
        if (StringUtils.isNotEmpty(bulletsEnabled)) {
            cursor.setBulletsEnabled(Boolean.valueOf(bulletsEnabled));
        }
        String bulletSize = cursorElement.attributeValue("bulletSize");
        if (StringUtils.isNotEmpty(bulletSize)) {
            cursor.setBulletSize(Integer.valueOf(bulletSize));
        }
        String categoryBalloonAlpha = cursorElement.attributeValue("categoryBalloonAlpha");
        if (StringUtils.isNotEmpty(categoryBalloonAlpha)) {
            cursor.setCategoryBalloonAlpha(Double.valueOf(categoryBalloonAlpha));
        }
        String categoryBalloonColor = cursorElement.attributeValue("categoryBalloonColor");
        if (StringUtils.isNotEmpty(categoryBalloonColor)) {
            cursor.setCategoryBalloonColor(Color.valueOf(categoryBalloonColor));
        }
        String categoryBalloonDateFormat = cursorElement.attributeValue("categoryBalloonDateFormat");
        if (StringUtils.isNotEmpty(categoryBalloonDateFormat)) {
            cursor.setCategoryBalloonDateFormat(loadResourceString(categoryBalloonDateFormat));
        }
        String categoryBalloonEnabled = cursorElement.attributeValue("categoryBalloonEnabled");
        if (StringUtils.isNotEmpty(categoryBalloonEnabled)) {
            cursor.setCategoryBalloonEnabled(Boolean.valueOf(categoryBalloonEnabled));
        }
        String categoryBalloonText = cursorElement.attributeValue("categoryBalloonText");
        if (StringUtils.isNotEmpty(categoryBalloonText)) {
            cursor.setCategoryBalloonText(categoryBalloonText);
        }
        String color = cursorElement.attributeValue("color");
        if (StringUtils.isNotEmpty(color)) {
            cursor.setColor(Color.valueOf(color));
        }
        String cursorAlpha = cursorElement.attributeValue("cursorAlpha");
        if (StringUtils.isNotEmpty(cursorAlpha)) {
            cursor.setCursorAlpha(Double.valueOf(cursorAlpha));
        }
        String cursorColor = cursorElement.attributeValue("cursorColor");
        if (StringUtils.isNotEmpty(cursorColor)) {
            cursor.setCursorColor(Color.valueOf(cursorColor));
        }
        String cursorPosition = cursorElement.attributeValue("cursorPosition");
        if (StringUtils.isNotEmpty(cursorPosition)) {
            cursor.setCursorPosition(CursorPosition.valueOf(cursorPosition));
        }
        String enabled = cursorElement.attributeValue("enabled");
        if (StringUtils.isNotEmpty(enabled)) {
            cursor.setEnabled(Boolean.valueOf(enabled));
        }
        String fullWidth = cursorElement.attributeValue("fullWidth");
        if (StringUtils.isNotEmpty(fullWidth)) {
            cursor.setFullWidth(Boolean.valueOf(fullWidth));
        }
        String graphBulletAlpha = cursorElement.attributeValue("graphBulletAlpha");
        if (StringUtils.isNotEmpty(graphBulletAlpha)) {
            cursor.setGraphBulletAlpha(Double.valueOf(graphBulletAlpha));
        }
        String graphBulletSize = cursorElement.attributeValue("graphBulletSize");
        if (StringUtils.isNotEmpty(graphBulletSize)) {
            cursor.setGraphBulletSize(Double.valueOf(graphBulletSize));
        }
        String oneBalloonOnly = cursorElement.attributeValue("oneBalloonOnly");
        if (StringUtils.isNotEmpty(oneBalloonOnly)) {
            cursor.setOneBalloonOnly(Boolean.valueOf(oneBalloonOnly));
        }
        String leaveAfterTouch = cursorElement.attributeValue("leaveAfterTouch");
        if (StringUtils.isNotEmpty(leaveAfterTouch)) {
            cursor.setLeaveAfterTouch(Boolean.valueOf(leaveAfterTouch));
        }
        String leaveCursor = cursorElement.attributeValue("leaveCursor");
        if (StringUtils.isNotEmpty(leaveCursor)) {
            cursor.setLeaveCursor(Boolean.valueOf(leaveCursor));
        }
        String limitToGraph = cursorElement.attributeValue("limitToGraph");
        if (StringUtils.isNotEmpty(limitToGraph)) {
            cursor.setLimitToGraph(limitToGraph);
        }
        String pan = cursorElement.attributeValue("pan");
        if (StringUtils.isNotEmpty(pan)) {
            cursor.setPan(Boolean.valueOf(pan));
        }
        String selectionAlpha = cursorElement.attributeValue("selectionAlpha");
        if (StringUtils.isNotEmpty(selectionAlpha)) {
            cursor.setCursorAlpha(Double.valueOf(selectionAlpha));
        }
        String selectWithoutZooming = cursorElement.attributeValue("selectWithoutZooming");
        if (StringUtils.isNotEmpty(selectWithoutZooming)) {
            cursor.setSelectWithoutZooming(Boolean.valueOf(selectWithoutZooming));
        }
        String showNextAvailable = cursorElement.attributeValue("showNextAvailable");
        if (StringUtils.isNotEmpty(showNextAvailable)) {
            cursor.setShowNextAvailable(Boolean.valueOf(showNextAvailable));
        }
        String valueBalloonsEnabled = cursorElement.attributeValue("valueBalloonsEnabled");
        if (StringUtils.isNotEmpty(valueBalloonsEnabled)) {
            cursor.setValueBalloonsEnabled(Boolean.valueOf(valueBalloonsEnabled));
        }
        String valueLineAlpha = cursorElement.attributeValue("valueLineAlpha");
        if (StringUtils.isNotEmpty(valueLineAlpha)) {
            cursor.setValueLineAlpha(Double.valueOf(valueLineAlpha));
        }
        String valueLineAxis = cursorElement.attributeValue("valueLineAxis");
        if (StringUtils.isNotEmpty(valueLineAxis)) {
            cursor.setValueLineAxis(valueLineAxis);
        }
        String valueLineBalloonEnabled = cursorElement.attributeValue("valueLineBalloonEnabled");
        if (StringUtils.isNotEmpty(valueLineBalloonEnabled)) {
            cursor.setValueLineBalloonEnabled(Boolean.valueOf(valueLineBalloonEnabled));
        }
        String valueLineEnabled = cursorElement.attributeValue("valueLineEnabled");
        if (StringUtils.isNotEmpty(valueLineEnabled)) {
            cursor.setValueLineEnabled(Boolean.valueOf(valueLineEnabled));
        }
        String valueZoomable = cursorElement.attributeValue("valueZoomable");
        if (StringUtils.isNotEmpty(valueZoomable)) {
            cursor.setValueZoomable(Boolean.valueOf(valueZoomable));
        }
        String zoomable = cursorElement.attributeValue("zoomable");
        if (StringUtils.isNotEmpty(zoomable)) {
            cursor.setZoomable(Boolean.valueOf(zoomable));
        }
        String tabIndex = cursorElement.attributeValue("tabIndex");
        if (StringUtils.isNotEmpty(tabIndex)) {
            cursor.setTabIndex(Integer.parseInt(tabIndex));
        }
        chart.setChartCursor(cursor);
    }
}
Also used : JsFunction(io.jmix.charts.model.JsFunction) Element(org.dom4j.Element) Cursor(io.jmix.charts.model.cursor.Cursor)

Example 10 with JsFunction

use of io.jmix.charts.model.JsFunction in project jmix by jmix-framework.

the class SlicedChartLoader method loadConfiguration.

@Override
protected void loadConfiguration(T chart, Element element) {
    super.loadConfiguration(chart, element);
    loadChartData(chart, element);
    loadColors(chart, element);
    loadGradientRatios(chart, element);
    String accessibleLabel = element.attributeValue("accessibleLabel");
    if (StringUtils.isNotEmpty(accessibleLabel)) {
        chart.setAccessibleLabel(accessibleLabel);
    }
    String alpha = element.attributeValue("alpha");
    if (StringUtils.isNotEmpty(alpha)) {
        chart.setAlpha(Double.valueOf(alpha));
    }
    String alphaField = element.attributeValue("alphaField");
    if (StringUtils.isNotEmpty(alphaField)) {
        chart.setAlphaField(alphaField);
    }
    String baseColor = element.attributeValue("baseColor");
    if (StringUtils.isNotEmpty(baseColor)) {
        chart.setBaseColor(Color.valueOf(baseColor));
    }
    String classNameField = element.attributeValue("classNameField");
    if (StringUtils.isNotEmpty(classNameField)) {
        chart.setClassNameField(classNameField);
    }
    String colorField = element.attributeValue("colorField");
    if (StringUtils.isNotEmpty(colorField)) {
        chart.setColorField(colorField);
    }
    String descriptionField = element.attributeValue("descriptionField");
    if (StringUtils.isNotEmpty(descriptionField)) {
        chart.setDescriptionField(descriptionField);
    }
    String groupedAlpha = element.attributeValue("groupedAlpha");
    if (StringUtils.isNotEmpty(groupedAlpha)) {
        chart.setGroupedAlpha(Double.valueOf(groupedAlpha));
    }
    String groupedColor = element.attributeValue("groupedColor");
    if (StringUtils.isNotEmpty(groupedColor)) {
        chart.setGroupedColor(Color.valueOf(groupedColor));
    }
    String groupedDescription = element.attributeValue("groupedDescription");
    if (StringUtils.isNotEmpty(groupedDescription)) {
        chart.setGroupedDescription(loadResourceString(groupedDescription));
    }
    String groupedPulled = element.attributeValue("groupedPulled");
    if (StringUtils.isNotEmpty(groupedPulled)) {
        chart.setGroupedPulled(Boolean.valueOf(groupedPulled));
    }
    String groupedTitle = element.attributeValue("groupedTitle");
    if (StringUtils.isNotEmpty(groupedTitle)) {
        chart.setGroupedTitle(loadResourceString(groupedTitle));
    }
    String groupPercent = element.attributeValue("groupPercent");
    if (StringUtils.isNotEmpty(groupPercent)) {
        chart.setGroupPercent(Double.valueOf(groupPercent));
    }
    String hideLabelsPercent = element.attributeValue("hideLabelsPercent");
    if (StringUtils.isNotEmpty(hideLabelsPercent)) {
        chart.setHideLabelsPercent(Double.valueOf(hideLabelsPercent));
    }
    String hoverAlpha = element.attributeValue("hoverAlpha");
    if (StringUtils.isNotEmpty(hoverAlpha)) {
        chart.setHoverAlpha(Double.valueOf(hoverAlpha));
    }
    String labelColorField = element.attributeValue("labelColorField");
    if (StringUtils.isNotEmpty(labelColorField)) {
        chart.setLabelColorField(Color.valueOf(labelColorField));
    }
    String labelFunction = element.elementText("labelFunction");
    if (StringUtils.isNotEmpty(labelFunction)) {
        chart.setLabelFunction(new JsFunction(labelFunction));
    }
    String labelsEnabled = element.attributeValue("labelsEnabled");
    if (StringUtils.isNotEmpty(labelsEnabled)) {
        chart.setLabelsEnabled(Boolean.valueOf(labelsEnabled));
    }
    String labelTickAlpha = element.attributeValue("labelTickAlpha");
    if (StringUtils.isNotEmpty(labelTickAlpha)) {
        chart.setLabelTickAlpha(Double.valueOf(labelTickAlpha));
    }
    String labelTickColor = element.attributeValue("labelTickColor");
    if (StringUtils.isNotEmpty(labelTickColor)) {
        chart.setLabelTickColor(Color.valueOf(labelTickColor));
    }
    loadMargins(chart, element);
    String maxLabelWidth = element.attributeValue("maxLabelWidth");
    if (StringUtils.isNotEmpty(maxLabelWidth)) {
        chart.setMaxLabelWidth(Integer.valueOf(maxLabelWidth));
    }
    String outlineAlpha = element.attributeValue("outlineAlpha");
    if (StringUtils.isNotEmpty(outlineAlpha)) {
        chart.setOutlineAlpha(Double.valueOf(outlineAlpha));
    }
    String outlineColor = element.attributeValue("outlineColor");
    if (StringUtils.isNotEmpty(outlineColor)) {
        chart.setOutlineColor(Color.valueOf(outlineColor));
    }
    String outlineThickness = element.attributeValue("outlineThickness");
    if (StringUtils.isNotEmpty(outlineThickness)) {
        chart.setOutlineThickness(Integer.valueOf(outlineThickness));
    }
    String patternField = element.attributeValue("patternField");
    if (StringUtils.isNotEmpty(patternField)) {
        chart.setPatternField(patternField);
    }
    String pulledField = element.attributeValue("pulledField");
    if (StringUtils.isNotEmpty(pulledField)) {
        chart.setPulledField(pulledField);
    }
    String pullOutDuration = element.attributeValue("pullOutDuration");
    if (StringUtils.isNotEmpty(pullOutDuration)) {
        chart.setPullOutDuration(Integer.valueOf(pullOutDuration));
    }
    String pullOutEffect = element.attributeValue("pullOutEffect");
    if (StringUtils.isNotEmpty(pullOutEffect)) {
        chart.setPullOutEffect(AnimationEffect.valueOf(pullOutEffect));
    }
    String pullOutOnlyOne = element.attributeValue("pullOutOnlyOne");
    if (StringUtils.isNotEmpty(pullOutOnlyOne)) {
        chart.setPullOutOnlyOne(Boolean.valueOf(pullOutOnlyOne));
    }
    String sequencedAnimation = element.attributeValue("sequencedAnimation");
    if (StringUtils.isNotEmpty(sequencedAnimation)) {
        chart.setSequencedAnimation(Boolean.valueOf(sequencedAnimation));
    }
    String showZeroSlices = element.attributeValue("showZeroSlices");
    if (StringUtils.isNotEmpty(showZeroSlices)) {
        chart.setShowZeroSlices(Boolean.valueOf(showZeroSlices));
    }
    String startAlpha = element.attributeValue("startAlpha");
    if (StringUtils.isNotEmpty(startAlpha)) {
        chart.setStartAlpha(Double.valueOf(startAlpha));
    }
    String tabIndex = element.attributeValue("tabIndex");
    if (StringUtils.isNotEmpty(tabIndex)) {
        chart.setTabIndex(Integer.valueOf(tabIndex));
    }
    loadStartEffect(chart, element);
    String titleField = element.attributeValue("titleField");
    if (StringUtils.isNotEmpty(titleField)) {
        chart.setTitleField(titleField);
    }
    String urlField = element.attributeValue("urlField");
    if (StringUtils.isNotEmpty(urlField)) {
        chart.setUrlField(urlField);
    }
    String urlTarget = element.attributeValue("urlTarget");
    if (StringUtils.isNotEmpty(urlTarget)) {
        chart.setUrlTarget(urlTarget);
    }
    String valueField = element.attributeValue("valueField");
    if (StringUtils.isNotEmpty(valueField)) {
        chart.setValueField(valueField);
    }
    String visibleInLegendField = element.attributeValue("visibleInLegendField");
    if (StringUtils.isNotEmpty(visibleInLegendField)) {
        chart.setVisibleInLegendField(visibleInLegendField);
    }
}
Also used : JsFunction(io.jmix.charts.model.JsFunction)

Aggregations

JsFunction (io.jmix.charts.model.JsFunction)10 Element (org.dom4j.Element)6 DatePeriod (io.jmix.charts.model.date.DatePeriod)2 GaugeAxis (io.jmix.charts.model.GaugeAxis)1 Cursor (io.jmix.charts.model.cursor.Cursor)1 DateFormat (io.jmix.charts.model.date.DateFormat)1 Graph (io.jmix.charts.model.graph.Graph)1 ArrayList (java.util.ArrayList)1 FastDateFormat (org.apache.commons.lang3.time.FastDateFormat)1