Examples of NumberAxis


Examples of com.positive.charts.axis.NumberAxis

    if (orientation == null) {
      throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    final CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
    final ValueAxis valueAxis = new NumberAxis(valueAxisLabel);

    final BarRenderer renderer = new BarRenderer();
    if (orientation == PlotOrientation.HORIZONTAL) {
      final ItemLabelPosition position1 = new ItemLabelPosition(
          ItemLabelAnchor.OUTSIDE3, TextAnchor.CENTER_LEFT);
View Full Code Here

Examples of javafx.scene.chart.NumberAxis

        this(idProvider, title, yAxisTitle, null);
    }

    private void initialize() {
        final CategoryAxis xAxis = new CategoryAxis();
        final NumberAxis yAxis = new NumberAxis();
        yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis, yUnit, null));
        final LineChart chart = new LineChart(xAxis, yAxis);
        chart.setLegendVisible(false);
        chart.setTitle(title);
        yAxis.setLabel(yAxisTitle);
        yAxis.setForceZeroInRange(true);
        this.series = new XYChart.Series<String, Number>();
        chart.getData().add(series);
        this.chart = chart;
        this.chart.setId("snapshotChart");
        deactivate();
View Full Code Here

Examples of javafx.scene.chart.NumberAxis

    private void setShowTickMarks(boolean ticksVisible, boolean labelsVisible) {
        showTickMarks = (ticksVisible || labelsVisible);
        Slider slider = getSkinnable();
        if (showTickMarks) {
            if (tickLine == null) {
                tickLine = new NumberAxis();
                tickLine.setAutoRanging(false);
                tickLine.setSide(slider.getOrientation() == Orientation.VERTICAL ? Side.RIGHT : (slider.getOrientation() == null) ? Side.RIGHT: Side.BOTTOM);
                tickLine.setUpperBound(slider.getMax());
                tickLine.setLowerBound(slider.getMin());
                tickLine.setTickUnit(slider.getMajorTickUnit());
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis

    // set the X axis labels to be slanted
    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 3.0));

    // set the range axis to display integers only...
    final NumberAxis rangeAxis = (NumberAxis)plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    // set the max width of each bar
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setMaxBarWidth(0.10);
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis

      Color tickLabel = new Color(colors.getTickLabel());
     
      rangeAxis.setLabelPaint(axisLabel);
      rangeAxis.setTickLabelPaint(tickLabel);
      if(rangeAxis instanceof NumberAxis){
        NumberAxis numberAxis = (NumberAxis)rangeAxis;
        // rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
      }
     
      /**
       * DOAMIN AXIS settings
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis

  private JFreeChart createChart(final Expression aExpression)
  {
    if (aExpression instanceof BarLineChartExpression)
    {
      final CategoryAxis catAxis = new CategoryAxis("Category");// NON-NLS
      final NumberAxis barsAxis = new NumberAxis("Value");// NON-NLS
      final NumberAxis linesAxis = new NumberAxis("Value2");// NON-NLS

      final CategoryPlot plot = new CategoryPlot(createDataset(), catAxis, barsAxis, new BarRenderer());
      plot.setRenderer(1, new LineAndShapeRenderer());

      // add lines dataset and axis to plot
      plot.setDataset(1, createDataset());
      plot.setRangeAxis(1, linesAxis);

      // map lines to second axis
      plot.mapDatasetToRangeAxis(1, 1);

      // set rendering order
      plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);

      // set location of second axis
      plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT);

      return new JFreeChart("Bar Line Chart", plot);
    }

    if (aExpression instanceof RingChartExpression)
    {
      return ChartFactory.createRingChart("Ring Chart", createPieDataset(), true, false, false);// NON-NLS
    }
    if (aExpression instanceof AreaChartExpression)
    {
      return ChartFactory.createAreaChart("Area Chart", "Category", "Value", createDataset(), PlotOrientation.VERTICAL,
          true, false, false);// NON-NLS
    }
    if (aExpression instanceof BarChartExpression)
    {
      return ChartFactory.createBarChart("Bar Chart", "Category", "Value", createDataset(), PlotOrientation.VERTICAL,
          true, false, false);// NON-NLS

    }
    if (aExpression instanceof LineChartExpression)
    {
      return ChartFactory.createLineChart("Line Chart", "Category", "Value", createDataset(), PlotOrientation.VERTICAL,
          true, false, false);// NON-NLS
    }
    if (aExpression instanceof MultiPieChartExpression)
    {
      return ChartFactory.createMultiplePieChart("Multi Pie Chart", createDataset(), TableOrder.BY_COLUMN, true, false,
          false);// NON-NLS
    }
    if (aExpression instanceof PieChartExpression)
    {
      return ChartFactory.createPieChart("Pie Chart", createPieDataset(), true, false, false);// NON-NLS
    }
    if (aExpression instanceof WaterfallChartExpressions)
    {
      return ChartFactory.createWaterfallChart("Bar Chart", "Category", "Value", createDataset(),
          PlotOrientation.HORIZONTAL, true, false, false);// NON-NLS
    }
    if (aExpression instanceof BubbleChartExpression)
    {
      return ChartFactory.createBubbleChart("Bubble Chart", "X", "Y", createXYZDataset(), PlotOrientation.VERTICAL,
          true, false, false);// NON-NLS
    }
    if (aExpression instanceof ExtendedXYLineChartExpression)
    {
      return ChartFactory.createXYLineChart("XY Line Chart", "X", "Y", createXYZDataset(), PlotOrientation.VERTICAL,
          true, false, false);// NON-NLS
    }
    if (aExpression instanceof ScatterPlotChartExpression)
    {
      return ChartFactory.createScatterPlot("Scatter Chart", "X", "Y", createXYZDataset(), PlotOrientation.VERTICAL,
          true, false, false);// NON-NLS
    }
    if (aExpression instanceof XYAreaLineChartExpression)
    {
      final NumberAxis catAxis = new NumberAxis("Range");// NON-NLS
      final NumberAxis barsAxis = new NumberAxis("Value");// NON-NLS
      final NumberAxis linesAxis = new NumberAxis("Value2");// NON-NLS

      final XYPlot plot = new XYPlot(createXYZDataset(), catAxis, barsAxis, new XYAreaRenderer());
      plot.setRenderer(1, new XYLineAndShapeRenderer());

      // add lines dataset and axis to plot
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis


    final ValueAxis rangeAxis = cpl.getRangeAxis();
    if (rangeAxis instanceof NumberAxis)
    {
      final NumberAxis numberAxis = (NumberAxis) rangeAxis;

      if (getRangePeriodCount() > 0)
      {
        if (getRangeTickFormat() != null)
        {
          numberAxis.setTickUnit(new NumberTickUnit(getRangePeriodCount(), getRangeTickFormat()));
        }
        else if (getRangeTickFormatString() != null)
        {
          final FastDecimalFormat formatter = new FastDecimalFormat
              (getRangeTickFormatString(), getResourceBundleFactory().getLocale());
          numberAxis.setTickUnit(new FastNumberTickUnit(getRangePeriodCount(), formatter));
        }
        else
        {
          numberAxis.setTickUnit(new FastNumberTickUnit(getRangePeriodCount()));
        }
      }
      else
      {
        if (getRangeTickFormat() != null)
        {
          numberAxis.setNumberFormatOverride(getRangeTickFormat());
        }
        else if (getRangeTickFormatString() != null)
        {
          final DecimalFormat formatter = new DecimalFormat
              (getRangeTickFormatString(), new DecimalFormatSymbols(getResourceBundleFactory().getLocale()));
          numberAxis.setNumberFormatOverride(formatter);
        }
      }
    }
    else if (rangeAxis instanceof DateAxis)
    {
      final DateAxis numberAxis = (DateAxis) rangeAxis;

      if (getRangePeriodCount() > 0 && getRangeTimePeriod() != null)
      {
        if (getRangeTickFormatString() != null)
        {
          final SimpleDateFormat formatter = new SimpleDateFormat
              (getRangeTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
          numberAxis.setTickUnit
              (new DateTickUnit(getDateUnitAsInt(getRangeTimePeriod()), (int) getRangePeriodCount(), formatter));
        }
        else
        {
          numberAxis.setTickUnit
              (new DateTickUnit(getDateUnitAsInt(getRangeTimePeriod()), (int) getRangePeriodCount()));
        }
      }
      else if (getRangeTickFormatString() != null)
      {
        final SimpleDateFormat formatter = new SimpleDateFormat
            (getRangeTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
        numberAxis.setDateFormatOverride(formatter);
      }

    }

    if (rangeAxis != null)
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis

      throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    final CategoryAxis categoryAxis = new FormattedCategoryAxis(categoryAxisLabel,
        getCategoricalAxisMessageFormat(), getRuntime().getResourceBundleFactory().getLocale());
    categoryAxis.setCategoryMargin(0.0);
    final ValueAxis valueAxis = new NumberAxis(valueAxisLabel);

    final StackedAreaRenderer renderer = new StackedAreaRenderer();
    if (tooltips)
    {
      renderer.setBaseToolTipGenerator(
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis

      {
        linesAxis = new NumberAxis3D(getSecondValueAxisLabel());
      }
      else
      {
        linesAxis = new NumberAxis(getSecondValueAxisLabel());
      }

      plot.setRenderer(1, lineRenderer);
      plot.setDataset(1, linesDataset);
      plot.setRangeAxis(1, linesAxis);
View Full Code Here

Examples of org.jfree.chart.axis.NumberAxis

    if (isSharedRangeAxis() == false)
    {
      final ValueAxis linesAxis = plot.getRangeAxis(1);
      if (linesAxis instanceof NumberAxis)
      {
        final NumberAxis numberAxis = (NumberAxis) linesAxis;

        if (getLinePeriodCount() > 0)
        {
          if (getLineTicksLabelFormat() != null)
          {
            final FastDecimalFormat formatter = new FastDecimalFormat
                (getLineTicksLabelFormat(), getResourceBundleFactory().getLocale());
            numberAxis.setTickUnit(new FastNumberTickUnit(getLinePeriodCount(), formatter));
          }
          else
          {
            numberAxis.setTickUnit(new FastNumberTickUnit(getLinePeriodCount()));
          }
        }
        else
        {
          if (getLineTicksLabelFormat() != null)
          {
            final DecimalFormat formatter = new DecimalFormat
                (getLineTicksLabelFormat(), new DecimalFormatSymbols(getResourceBundleFactory().getLocale()));
            numberAxis.setNumberFormatOverride(formatter);
          }
        }
      }
      else if (linesAxis instanceof DateAxis)
      {
        final DateAxis numberAxis = (DateAxis) linesAxis;

        if (getLinePeriodCount() > 0 && getLineTimePeriod() != null)
        {
          if (getLineTicksLabelFormat() != null)
          {
            final SimpleDateFormat formatter = new SimpleDateFormat
                (getLineTicksLabelFormat(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
            numberAxis.setTickUnit
                (new DateTickUnit(getDateUnitAsInt(getLineTimePeriod()), (int) getLinePeriodCount(), formatter));
          }
          else
          {
            numberAxis.setTickUnit
                (new DateTickUnit(getDateUnitAsInt(getLineTimePeriod()), (int) getLinePeriodCount()));
          }
        }
        else if (getRangeTickFormatString() != null)
        {
          final SimpleDateFormat formatter = new SimpleDateFormat
              (getRangeTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
          numberAxis.setDateFormatOverride(formatter);
        }
      }

      if (linesAxis != null)
      {
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.