Tabnine Logo
org.jfree.chart.axis
Code IndexAdd Tabnine to your IDE (free)

How to use org.jfree.chart.axis

Best Java code snippets using org.jfree.chart.axis (Showing top 20 results out of 1,098)

origin: jenkinsci/jenkins

protected void configureRangeAxis(NumberAxis rangeAxis) {
  rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
  rangeAxis.setTickLabelFont(CHART_FONT);
  rangeAxis.setLabelFont(CHART_FONT);
}
origin: jenkinsci/jenkins

protected CategoryAxis configureDomainAxis(CategoryPlot plot) {
  final CategoryAxis domainAxis = new NoOverlapCategoryAxis(null);
  plot.setDomainAxis(domainAxis);
  domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
  domainAxis.setLowerMargin(0.0);
  domainAxis.setUpperMargin(0.0);
  domainAxis.setCategoryMargin(0.0);
  domainAxis.setLabelFont(CHART_FONT);
  domainAxis.setTickLabelFont(CHART_FONT);
  return domainAxis;
}
origin: kiegroup/optaplanner

private CategoryPlot createBarChartPlot(DefaultCategoryDataset dataset,
    String yAxisLabel, NumberFormat yAxisNumberFormat) {
  CategoryAxis xAxis = new CategoryAxis("Data");
  xAxis.setCategoryMargin(0.40);
  NumberAxis yAxis = new NumberAxis(yAxisLabel);
  yAxis.setNumberFormatOverride(yAxisNumberFormat);
  BarRenderer renderer = createBarChartRenderer(yAxisNumberFormat);
  CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}
origin: jenkinsci/jenkins

domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
domainAxis.setLowerMargin(0.0);
domainAxis.setUpperMargin(0.0);
domainAxis.setCategoryMargin(0.0);
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  NumberAxis yAxis = new NumberAxis("Best solution mutation count");
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(true);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}
origin: kiegroup/optaplanner

private CategoryPlot createBoxAndWhiskerChartPlot(DefaultBoxAndWhiskerCategoryDataset dataset,
    String yAxisLabel, NumberFormat yAxisNumberFormat) {
  CategoryAxis xAxis = new CategoryAxis("Data");
  NumberAxis yAxis = new NumberAxis(yAxisLabel);
  yAxis.setNumberFormatOverride(yAxisNumberFormat);
  BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
  renderer.setItemMargin(0.10);
  renderer.setMeanVisible(false);
  // Improve readability by avoiding low contrast with light colors
  renderer.setUseOutlinePaintForWhiskers(true);
  CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}
origin: kiegroup/optaplanner

private XYPlot createScalabilityPlot(List<XYSeries> seriesList,
    String xAxisLabel, NumberFormat xAxisNumberFormat,
    String yAxisLabel, NumberFormat yAxisNumberFormat) {
  NumberAxis xAxis;
  if (useLogarithmicProblemScale(seriesList)) {
    LogarithmicAxis logarithmicAxis = new LogarithmicAxis(xAxisLabel + " (logarithmic)");
    logarithmicAxis.setAllowNegativesFlag(true);
    xAxis = logarithmicAxis;
  } else {
    xAxis = new NumberAxis(xAxisLabel);
  }
  xAxis.setNumberFormatOverride(xAxisNumberFormat);
  NumberAxis yAxis = new NumberAxis(yAxisLabel);
  yAxis.setNumberFormatOverride(yAxisNumberFormat);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  int seriesIndex = 0;
  for (XYSeries series : seriesList) {
    XYSeriesCollection seriesCollection = new XYSeriesCollection();
    seriesCollection.addSeries(series);
    plot.setDataset(seriesIndex, seriesCollection);
    XYItemRenderer renderer = createScalabilityPlotRenderer(yAxisNumberFormat);
    plot.setRenderer(seriesIndex, renderer);
    seriesIndex++;
  }
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}
origin: kiegroup/optaplanner

private JFreeChart createChart(CheapTimeSolution solution) {
  TangoColorFactory tangoColorFactory = new TangoColorFactory();
  NumberAxis rangeAxis = new NumberAxis("Period");
  rangeAxis.setRange(-0.5, solution.getGlobalPeriodRangeTo() + 0.5);
  XYPlot taskAssignmentPlot = createTaskAssignmentPlot(tangoColorFactory, solution);
  XYPlot periodCostPlot = createPeriodCostPlot(tangoColorFactory, solution);
  XYPlot capacityPlot = createAvailableCapacityPlot(tangoColorFactory, solution);
  CombinedRangeXYPlot combinedPlot = new CombinedRangeXYPlot(rangeAxis);
  combinedPlot.add(taskAssignmentPlot, 5);
  combinedPlot.add(periodCostPlot, 1);
  combinedPlot.add(capacityPlot, 1);
  combinedPlot.setOrientation(PlotOrientation.HORIZONTAL);
  return new JFreeChart("Cheap Power Time Scheduling", JFreeChart.DEFAULT_TITLE_FONT,
      combinedPlot, true);
}
origin: stackoverflow.com

renderer.setSeriesPaint(0, Color.blue);
NumberAxis domain = (NumberAxis) xyPlot.getDomainAxis();
domain.setRange(0.00, 1.00);
domain.setTickUnit(new NumberTickUnit(0.1));
domain.setVerticalTickLabels(true);
NumberAxis range = (NumberAxis) xyPlot.getRangeAxis();
range.setRange(0.0, 1.0);
range.setTickUnit(new NumberTickUnit(0.1));
return new ChartPanel(jfreechart);
origin: jenkinsci/jenkins

state.setTicks(ticks);
  g2.setFont(getTickLabelFont(tick.getCategory()));
  g2.setPaint(getTickLabelPaint(tick.getCategory()));
    = this.getCategoryLabelPositions().getLabelPosition(edge);
  double x0 = 0.0;
  double x1 = 0.0;
    x1 = getCategoryEnd(categoryIndex, ticks.size(), dataArea,
        edge);
    y1 = state.getCursor() - this.getCategoryLabelPositionOffset();
    y0 = y1 - state.getMax();
    x1 = getCategoryEnd(categoryIndex, ticks.size(), dataArea,
        edge);
    y0 = state.getCursor() + this.getCategoryLabelPositionOffset();
    y1 = y0 + state.getMax();
    y1 = getCategoryEnd(categoryIndex, ticks.size(), dataArea,
        edge);
    x1 = state.getCursor() - this.getCategoryLabelPositionOffset();
    x0 = x1 - state.getMax();
    y1 = getCategoryEnd(categoryIndex, ticks.size(), dataArea,
        edge);
    x0 = state.getCursor() + this.getCategoryLabelPositionOffset();
    x1 = x0 - state.getMax();
origin: kiegroup/optaplanner

private XYPlot createPeriodCostPlot(TangoColorFactory tangoColorFactory, CheapTimeSolution solution) {
  XYSeries series = new XYSeries("Power price");
  for (PeriodPowerPrice periodPowerPrice : solution.getPeriodPowerPriceList()) {
    series.add((double) periodPowerPrice.getPowerPriceMicros() / 1000000.0, periodPowerPrice.getPeriod());
  }
  XYSeriesCollection seriesCollection = new XYSeriesCollection();
  seriesCollection.addSeries(series);
  XYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES);
  renderer.setSeriesPaint(0, TangoColorFactory.ORANGE_1);
  renderer.setSeriesShape(0, ShapeUtilities.createDiamond(2.0F));
  NumberAxis domainAxis = new NumberAxis("Power price");
  return new XYPlot(seriesCollection, domainAxis, null, renderer);
}
origin: jenkinsci/jenkins

max += yAxis.getUpperMargin()*(max-min);
yAxis.setRange(min,max);
origin: jenkinsci/jenkins

double xx1 = domainAxis.getCategoryMiddle(column, getColumnCount(),
    dataArea, plot.getDomainAxisEdge());
double y1 = value + previousHeightx1;
RectangleEdge location = plot.getRangeAxisEdge();
double yy1 = rangeAxis.valueToJava2D(y1, dataArea, location);
  if (previousValue != null) {
    double xx0 = domainAxis.getCategoryMiddle(column - 1,
        getColumnCount(), dataArea, plot.getDomainAxisEdge());
    double y0 = previousValue.doubleValue();
    double previousHeightxx0 = rangeAxis.valueToJava2D(
        previousHeightx0, dataArea, location);
    double previousHeightxx1 = rangeAxis.valueToJava2D(
        previousHeightx1, dataArea, location);
    double yy0 = rangeAxis.valueToJava2D(y0, dataArea, location);
origin: jenkinsci/jenkins

domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
domainAxis.setLowerMargin(0.0);
domainAxis.setUpperMargin(0.0);
domainAxis.setCategoryMargin(0.0);
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport, int scoreLevelIndex) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  String scoreLevelLabel = problemBenchmarkResult.findScoreLevelLabel(scoreLevelIndex);
  NumberAxis yAxis = new NumberAxis("Best " + scoreLevelLabel);
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(false);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}
origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport, int scoreLevelIndex) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  String scoreLevelLabel = problemBenchmarkResult.findScoreLevelLabel(scoreLevelIndex);
  NumberAxis yAxis = new NumberAxis("Step " + scoreLevelLabel);
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(false);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}
origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport, int scoreLevelIndex) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  String scoreLevelLabel = subSingleBenchmarkResult.getSingleBenchmarkResult().getProblemBenchmarkResult()
      .findScoreLevelLabel(scoreLevelIndex);
  NumberAxis yAxis = new NumberAxis("Constraint match total " + scoreLevelLabel);
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(false);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}
origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport, int scoreLevelIndex) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  String scoreLevelLabel = subSingleBenchmarkResult.getSingleBenchmarkResult().getProblemBenchmarkResult()
      .findScoreLevelLabel(scoreLevelIndex);
  NumberAxis yAxis = new NumberAxis("Step " + scoreLevelLabel + " diff");
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(true);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}
origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport, int scoreLevelIndex) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  String scoreLevelLabel = subSingleBenchmarkResult.getSingleBenchmarkResult().getProblemBenchmarkResult()
      .findScoreLevelLabel(scoreLevelIndex);
  NumberAxis yAxis = new NumberAxis("Best " + scoreLevelLabel + "  diff");
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(true);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}
origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport, int scoreLevelIndex) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  String scoreLevelLabel = subSingleBenchmarkResult.getSingleBenchmarkResult().getProblemBenchmarkResult()
      .findScoreLevelLabel(scoreLevelIndex);
  NumberAxis yAxis = new NumberAxis("Constraint match total " + scoreLevelLabel);
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(false);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}
org.jfree.chart.axis

Most used classes

  • NumberAxis
    An axis for displaying numerical data. If the axis is set up to automatically determine its range to
  • ValueAxis
    The base class for axes that display value data, where values are measured using the double primitiv
  • CategoryAxis
    An axis that displays categories.
  • DateAxis
    The base class for axes that display dates. You will find it easier to understand how this axis work
  • NumberTickUnit
    A numerical tick unit.
  • CategoryLabelPositions,
  • NumberTick,
  • AxisState,
  • CategoryLabelPosition,
  • Axis,
  • DateTickUnit,
  • CategoryTick,
  • TickUnits,
  • PeriodAxisLabelInfo,
  • ExtendedCategoryAxis,
  • NumberAxis3D,
  • PeriodAxis,
  • SubCategoryAxis,
  • SymbolAxis
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now