Jump to content
We've recently updated our Privacy Statement, available here ×

prestinman

Members
  • Posts

    1
  • Joined

  • Last visited

prestinman's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Hello. I am creating a JasperReport with an XYBlock chart. Everything shows up fine except the gridlines on the chart. They only slightly appear if I set the foregroundAlpha(0.25f)...which makes me think that the gridlines are getting painted over. Does anyone know how to show the gridlines or move them to the front? I am using JFreeChart 1.0.12 and jasperReports 3.7.2 Any suggestion is appreciated. Thanks! Code: XYZDataset dataset = createDataset(sched); NumberAxis xAxis = new NumberAxis(""); xAxis.setLowerMargin(0.0); xAxis.setUpperMargin(0.0); xAxis.setTickUnit(new NumberTickUnit(12.0)); xAxis.setNumberFormatOverride(new DayGraphNumberFormat()); NumberAxis yAxis = new NumberAxis(""); yAxis.setLowerMargin(0.0); yAxis.setUpperMargin(0.0); yAxis.setTickUnit(new NumberTickUnit(1.0)); yAxis.setNumberFormatOverride(new WeekDayNumberFormat()); yAxis.setAutoRangeIncludesZero(false); yAxis.setInverted(true); XYBlockRenderer renderer = new XYBlockRenderer(); LookupPaintScale paintScale = new LookupPaintScale(0.0,1.0,Color.black); paintScale.add(0.0,new Color(216,220,166)); paintScale.add(1.0,Color.green); renderer.setPaintScale(paintScale); XYPlot plot = new XYPlot(dataset,yAxis,xAxis,renderer); plot.setOrientation(PlotOrientation.HORIZONTAL); plot.setForegroundAlpha(0.25f); plot.setDomainGridlinePaint(Color.BLUE); plot.setDomainGridlinesVisible(true); plot.setDomainGridlineStroke(new BasicStroke(1.0f)); plot.setRangeGridlinePaint(Color.BLUE); plot.setRangeGridlinesVisible(true); plot.setRangeMinorGridlinesVisible(false); plot.setRangeGridlineStroke(new BasicStroke(1.0f)); plot.setAxisOffset(new RectangleInsets(5,5,5,5)); JFreeChart chart = new JFreeChart("",plot); chart.setBackgroundPaint(new Color(253,250,247)); chart.removeLegend();
×
×
  • Create New...