Package org.thechiselgroup.choosel.protovis.client

Examples of org.thechiselgroup.choosel.protovis.client.PVLinearScale


        calculateChartVariables();
        setChartParameters();

        calculateMaximumChartItemValue();
        PVLinearScale scale = PV.Scale.linear(0, maxChartItemValue).range(0,
                chartHeight);
        drawScales(scale);
        drawSelectionBox();
        drawDot();
View Full Code Here


        return regularWedgeCounts[i] * (Math.min(height, width) - MARGIN_SIZE)
                / (ArrayUtils.max(regularWedgeCounts) * 2);
    }

    private void drawScale() {
        PVLinearScale scale = PV.Scale.linear(0, maxChartItemValue).range(0,
                Math.min(height, width) - MARGIN_SIZE);

        getChart().add(PV.Dot).data(scale.ticks()).left(width / 2)
                .bottom(height / 2).fillStyle("").strokeStyle(Colors.GRAY_1)
                .lineWidth(scaleLineWidth).radius(scaleRadius);
    }
View Full Code Here

        calculateChartVariables();
        setChartParameters();

        calculateMaximumChartItemValue();
        PVLinearScale scale = PV.Scale.linear(0, maxChartItemValue).range(0,
                chartHeight);
        drawScales(scale);
        drawSelectionBox();
        drawDot();
View Full Code Here

        return regularWedgeCounts[i] * (Math.min(height, width) - MARGIN_SIZE)
                / (ArrayUtils.max(regularWedgeCounts) * 2);
    }

    private void drawScale() {
        PVLinearScale scale = PV.Scale.linear(0, maxChartItemValue).range(0,
                Math.min(height, width) - MARGIN_SIZE);

        getChart().add(PV.Dot).data(scale.ticks()).left(width / 2)
                .bottom(height / 2).fillStyle("").strokeStyle(Colors.GRAY_1)
                .lineWidth(scaleLineWidth).radius(scaleRadius);
    }
View Full Code Here

                .text(new ViewItemStringSlotAccessor(BAR_LABEL))
                .textBaseline(PVAlignment.MIDDLE).events(ALL).cursor(POINTER);
    }

    private void drawHorizontalGridLines() {
        PVLinearScale scale = PV.Scale.linear(0, maxChartItemValue).range(0,
                chartWidth);
        getChart().add(PV.Rule).data(scale.ticks(5)).left(scale).bottom(0)
                .strokeStyle(scaleStrokeStyle).height(chartHeight)
                .anchor(PVAlignment.BOTTOM).add(PV.Label)
                .text(new TickFormatFunction(scale));
    }
View Full Code Here

    }

    // TODO extract scale ticks # as property
    protected void drawVerticalBarScales() {
        PVLinearScale scale = PV.Scale.linear(0, maxChartItemValue).range(0,
                chartHeight);
        getChart().add(PV.Rule).data(scale.ticks(5)).left(0).bottom(scale)
                .strokeStyle(scaleStrokeStyle).width(chartWidth)
                .anchor(PVAlignment.LEFT).add(PV.Label)
                .text(new TickFormatFunction(scale));
    }
View Full Code Here

                .text(new VisualItemStringSlotAccessor(BAR_LABEL))
                .textBaseline(PVAlignment.MIDDLE).events(ALL).cursor(POINTER);
    }

    private void drawHorizontalGridLines() {
        PVLinearScale scale = PV.Scale.linear(0, maxChartItemValue).range(0,
                chartWidth);
        getChart().add(PV.Rule).data(scale.ticks(5)).left(scale).bottom(0)
                .strokeStyle(scaleStrokeStyle).height(chartHeight)
                .anchor(PVAlignment.BOTTOM).add(PV.Label)
                .text(new TickFormatFunction(scale));
    }
View Full Code Here

    }

    // TODO extract scale ticks # as property
    protected void drawVerticalBarScales() {
        PVLinearScale scale = PV.Scale.linear(0, maxChartItemValue).range(0,
                chartHeight);
        getChart().add(PV.Rule).data(scale.ticks(5)).left(0).bottom(scale)
                .strokeStyle(scaleStrokeStyle).width(chartWidth)
                .anchor(PVAlignment.LEFT).add(PV.Label)
                .text(new TickFormatFunction(scale));
    }
View Full Code Here

        /* This maps an index to a value that it represents in the graph range */
        tickLabelValueScale = PV.Scale.linear(0, totalBarWidth).range(
                barScaleStart, barScaleEnd);

        /* A scale that maps 0 - 1000 to 50 - 1050 */
        PVLinearScale tickPositionScale = PV.Scale.linear(0, totalBarWidth)
                .range(LEFT_LABEL_PADDING, totalBarWidth + LEFT_LABEL_PADDING);

        /* Root panel */
        PVPanel vis = chartWidget
                .getPVPanel()
                .width(totalBarWidth + LEFT_LABEL_PADDING + CHART_RIGHT_PADDING)
                .height(chartHeight + CHART_BOTTOM_PADDING);

        /* Add one panel for each horizontal bar */
        PVPanel panel = vis.add(PV.Panel).data(dataPairs).top(panelTopFunction)
                .height(panelHeightFunction);

        /* an invisible panel that will handle mouse events */
        invisibleInteractionBar = vis.add(PV.Panel).data(visualItemsJsArray)
                .left(LEFT_LABEL_PADDING).width(totalBarWidthFunction)
                .top(panelTopFunction).height(panelHeightFunction)
                .cursor(POINTER).events(ALL)
                .strokeStyle(barBorderColorFunction).lineWidth(3);

        /* Add a label to each panel */
        panel.anchor(PVAlignment.LEFT).add(PV.Label).text(panelLabelFunction);

        PVPanel innerPanel = panel.add(PV.Panel).left(LEFT_LABEL_PADDING)
                .fillStyle("#ffffff");

        /* Add many vertical bars (slices) to each horizontal Panel (bar) */
        innerPanel.add(PV.Bar).data(childDataFunction).top(0)
                .left(sliceLeftFunction).width(sliceWidthFunction)
                .fillStyle(colorFunction);

        /* Add X axis ticks with number labels */
        vis.add(PV.Rule).data(tickPositionScale.ticks(calculateNumTicks()))
                .left(tickPositionScale).bottom(CHART_BOTTOM_PADDING).height(5)
                .strokeStyle("#000").anchor(PVAlignment.BOTTOM).add(PV.Label)
                .text(tickLabelFunction);
    }
View Full Code Here

TOP

Related Classes of org.thechiselgroup.choosel.protovis.client.PVLinearScale

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.