本文整理匯總了Java中org.jfree.chart.axis.ValueAxis.getLowerBound方法的典型用法代碼示例。如果您正苦於以下問題:Java ValueAxis.getLowerBound方法的具體用法?Java ValueAxis.getLowerBound怎麽用?Java ValueAxis.getLowerBound使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.axis.ValueAxis
的用法示例。
在下文中一共展示了ValueAxis.getLowerBound方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: shrinkSelectionYAxis
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
private void shrinkSelectionYAxis(double x, double y, Selection selectionObject, ValueAxis axis, int axisIndex,
double zoomFactor) {
Rectangle2D scaledDataArea = getScreenDataArea((int) x, (int) y);
double minY = scaledDataArea.getMinY();
double maxY = scaledDataArea.getMaxY();
double partToTop = (y - minY) / (maxY - minY);
double lowerDomain = axis.getLowerBound();
double upperDomain = axis.getUpperBound();
double middlePointTop = lowerDomain + (upperDomain - lowerDomain) * (1d - partToTop);
double width = (upperDomain - lowerDomain) * zoomFactor;
Range axisRange = new Range(middlePointTop - width / 2d, middlePointTop + width / 2d);
for (String axisName : axisNameResolver.resolveYAxis(axisIndex)) {
selectionObject.addDelimiter(axisName, axisRange);
}
}
示例2: shrinkSelectionXAxis
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
private void shrinkSelectionXAxis(double x, double y, Selection selectionObject, ValueAxis axis, int axisIndex,
double zoomFactor) {
Rectangle2D scaledDataArea = getScreenDataArea((int) x, (int) y);
double minX = scaledDataArea.getMinX();
double maxX = scaledDataArea.getMaxX();
double partToLeft = (x - minX) / (maxX - minX);
double lowerDomain = axis.getLowerBound();
double upperDomain = axis.getUpperBound();
double middlePointLeft = lowerDomain + (upperDomain - lowerDomain) * partToLeft;
double width = (upperDomain - lowerDomain) * zoomFactor;
Range domainRange = new Range(middlePointLeft - width / 2d, middlePointLeft + width / 2d);
for (String axisName : axisNameResolver.resolveXAxis(axisIndex)) {
selectionObject.addDelimiter(axisName, domainRange);
}
}
示例3: drawDomainTickBands
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Draws the domain tick bands, if any.
*
* @param g2 the graphics device.
* @param dataArea the data area.
* @param ticks the ticks.
*/
public void drawDomainTickBands(Graphics2D g2, Rectangle2D dataArea, List ticks) {
// draw the domain tick bands, if any...
Paint bandPaint = getDomainTickBandPaint();
if (bandPaint != null) {
boolean fillBand = false;
final ValueAxis xAxis = getDomainAxis();
double previous = xAxis.getLowerBound();
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
ValueTick tick = (ValueTick) iterator.next();
double current = tick.getValue();
if (fillBand) {
getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, current);
}
previous = current;
fillBand = !fillBand;
}
double end = xAxis.getUpperBound();
if (fillBand) {
getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea, previous, end);
}
}
}
示例4: drawRangeTickBands
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Draws the range tick bands, if any.
*
* @param g2 the graphics device.
* @param dataArea the data area.
* @param ticks the ticks.
*/
public void drawRangeTickBands(Graphics2D g2, Rectangle2D dataArea, List ticks) {
// draw the range tick bands, if any...
Paint bandPaint = getRangeTickBandPaint();
if (bandPaint != null) {
boolean fillBand = false;
final ValueAxis axis = getRangeAxis();
double previous = axis.getLowerBound();
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
ValueTick tick = (ValueTick) iterator.next();
double current = tick.getValue();
if (fillBand) {
getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, current);
}
previous = current;
fillBand = !fillBand;
}
double end = axis.getUpperBound();
if (fillBand) {
getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, end);
}
}
}
示例5: selectCompleteDomainBounds
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Restores the auto-range calculation on the domain axis.
*/
public void selectCompleteDomainBounds() {
Plot plot = this.chart.getPlot();
if (plot instanceof Zoomable) {
Zoomable z = (Zoomable) plot;
// here we tweak the notify flag on the plot so that only
// one notification happens even though we update multiple
// axes...
boolean savedNotify = plot.isNotify();
plot.setNotify(false);
// we need to guard against this.zoomPoint being null
Point2D zp = this.zoomPoint != null ? this.zoomPoint : new Point();
z.zoomDomainAxes(0.0, this.info.getPlotInfo(), zp);
plot.setNotify(savedNotify);
if (plot instanceof XYPlot) {
XYPlot xyPlot = (XYPlot) plot;
Selection selectionObject = new Selection();
for (int i = 0; i < xyPlot.getDomainAxisCount(); i++) {
ValueAxis domain = xyPlot.getDomainAxis(i);
Range axisRange = new Range(domain.getLowerBound(), domain.getUpperBound());
for (String axisName : axisNameResolver.resolveXAxis(i)) {
selectionObject.addDelimiter(axisName, axisRange);
}
}
informSelectionListener(selectionObject, null);
}
}
}
示例6: selectCompleteRangeBounds
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Restores the auto-range calculation on the range axis.
*/
public void selectCompleteRangeBounds() {
Plot plot = this.chart.getPlot();
if (plot instanceof Zoomable) {
Zoomable z = (Zoomable) plot;
// here we tweak the notify flag on the plot so that only
// one notification happens even though we update multiple
// axes...
boolean savedNotify = plot.isNotify();
plot.setNotify(false);
// we need to guard against this.zoomPoint being null
Point2D zp = this.zoomPoint != null ? this.zoomPoint : new Point();
z.zoomRangeAxes(0.0, this.info.getPlotInfo(), zp);
plot.setNotify(savedNotify);
if (plot instanceof XYPlot) {
XYPlot xyPlot = (XYPlot) plot;
Selection selectionObject = new Selection();
for (int i = 0; i < xyPlot.getRangeAxisCount(); i++) {
ValueAxis range = xyPlot.getRangeAxis(i);
Range axisRange = new Range(range.getLowerBound(), range.getUpperBound());
for (String axisName : axisNameResolver.resolveYAxis(i)) {
selectionObject.addDelimiter(axisName, axisRange);
}
}
informSelectionListener(selectionObject, null);
}
}
}
示例7: initialise
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Initialises the renderer then returns the number of 'passes' through the data that the
* renderer will require (usually just one). This method will be called before the first
* item is rendered, giving the renderer an opportunity to initialise any
* state information it wants to maintain. The renderer can do nothing if it chooses.
*
* @param g2 the graphics device.
* @param dataArea the area inside the axes.
* @param plot the plot.
* @param dataset the data.
* @param info an optional info collection object to return data back to the caller.
*
* @return The number of passes the renderer requires.
*/
public XYItemRendererState initialise(Graphics2D g2,
Rectangle2D dataArea,
XYPlot plot,
XYDataset dataset,
PlotRenderingInfo info) {
// calculate the maximum allowed candle width from the axis...
ValueAxis axis = plot.getDomainAxis();
double x1 = axis.getLowerBound();
double x2 = x1 + this.maxCandleWidthInMilliseconds;
RectangleEdge edge = plot.getDomainAxisEdge();
double xx1 = axis.valueToJava2D(x1, dataArea, edge);
double xx2 = axis.valueToJava2D(x2, dataArea, edge);
this.maxCandleWidth = Math.abs(xx2 - xx1); // Absolute value, since the relative x
// positions are reversed for horizontal orientation
// calculate the highest volume in the dataset...
if (this.drawVolume) {
OHLCDataset highLowDataset = (OHLCDataset) dataset;
this.maxVolume = 0.0;
for (int series = 0; series < highLowDataset.getSeriesCount(); series++) {
for (int item = 0; item < highLowDataset.getItemCount(series); item++) {
double volume = highLowDataset.getVolumeValue(series, item);
if (volume > this.maxVolume) {
this.maxVolume = volume;
}
}
}
}
return new XYItemRendererState(info);
}
示例8: initialise
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Initialises the renderer then returns the number of 'passes' through the
* data that the renderer will require (usually just one). This method
* will be called before the first item is rendered, giving the renderer
* an opportunity to initialise any state information it wants to maintain.
* The renderer can do nothing if it chooses.
*
* @param g2 the graphics device.
* @param dataArea the area inside the axes.
* @param plot the plot.
* @param dataset the data.
* @param info an optional info collection object to return data back to
* the caller.
*
* @return The number of passes the renderer requires.
*/
public XYItemRendererState initialise(Graphics2D g2,
Rectangle2D dataArea,
XYPlot plot,
XYDataset dataset,
PlotRenderingInfo info) {
// calculate the maximum allowed candle width from the axis...
ValueAxis axis = plot.getDomainAxis();
double x1 = axis.getLowerBound();
double x2 = x1 + this.maxCandleWidthInMilliseconds;
RectangleEdge edge = plot.getDomainAxisEdge();
double xx1 = axis.valueToJava2D(x1, dataArea, edge);
double xx2 = axis.valueToJava2D(x2, dataArea, edge);
this.maxCandleWidth = Math.abs(xx2 - xx1);
// Absolute value, since the relative x
// positions are reversed for horizontal orientation
// calculate the highest volume in the dataset...
if (this.drawVolume) {
OHLCDataset highLowDataset = (OHLCDataset) dataset;
this.maxVolume = 0.0;
for (int series = 0; series < highLowDataset.getSeriesCount();
series++) {
for (int item = 0; item < highLowDataset.getItemCount(series);
item++) {
double volume = highLowDataset.getVolumeValue(series, item);
if (volume > this.maxVolume) {
this.maxVolume = volume;
}
}
}
}
return new XYItemRendererState(info);
}
示例9: drawRadialGridLines
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Draw the radial gridlines - the rings.
*
* @param g2 the drawing surface.
* @param plot the plot.
* @param radialAxis the radial axis.
* @param ticks the ticks.
* @param dataArea the data area.
*/
public void drawRadialGridLines(Graphics2D g2,
PolarPlot plot,
ValueAxis radialAxis,
List ticks,
Rectangle2D dataArea) {
g2.setFont(radialAxis.getTickLabelFont());
g2.setPaint(plot.getRadiusGridlinePaint());
g2.setStroke(plot.getRadiusGridlineStroke());
double axisMin = radialAxis.getLowerBound();
Point center = plot.translateValueThetaRadiusToJava2D(axisMin, axisMin,
dataArea);
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
NumberTick tick = (NumberTick) iterator.next();
Point p = plot.translateValueThetaRadiusToJava2D(90.0,
tick.getNumber().doubleValue(), dataArea);
int r = p.x - center.x;
int upperLeftX = center.x - r;
int upperLeftY = center.y - r;
int d = 2 * r;
Ellipse2D ring = new Ellipse2D.Double(upperLeftX, upperLeftY, d, d);
g2.setPaint(plot.getRadiusGridlinePaint());
g2.draw(ring);
}
}
示例10: drawDomainTickBands
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Draws the domain tick bands, if any.
*
* @param g2 the graphics device.
* @param dataArea the data area.
* @param ticks the ticks.
*
* @see #setDomainTickBandPaint(Paint)
*/
public void drawDomainTickBands(Graphics2D g2, Rectangle2D dataArea,
List ticks) {
// draw the domain tick bands, if any...
Paint bandPaint = getDomainTickBandPaint();
if (bandPaint != null) {
boolean fillBand = false;
ValueAxis xAxis = getDomainAxis();
double previous = xAxis.getLowerBound();
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
ValueTick tick = (ValueTick) iterator.next();
double current = tick.getValue();
if (fillBand) {
getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea,
previous, current);
}
previous = current;
fillBand = !fillBand;
}
double end = xAxis.getUpperBound();
if (fillBand) {
getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea,
previous, end);
}
}
}
示例11: drawRangeTickBands
import org.jfree.chart.axis.ValueAxis; //導入方法依賴的package包/類
/**
* Draws the range tick bands, if any.
*
* @param g2 the graphics device.
* @param dataArea the data area.
* @param ticks the ticks.
*
* @see #setRangeTickBandPaint(Paint)
*/
public void drawRangeTickBands(Graphics2D g2, Rectangle2D dataArea,
List ticks) {
// draw the range tick bands, if any...
Paint bandPaint = getRangeTickBandPaint();
if (bandPaint != null) {
boolean fillBand = false;
ValueAxis axis = getRangeAxis();
double previous = axis.getLowerBound();
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
ValueTick tick = (ValueTick) iterator.next();
double current = tick.getValue();
if (fillBand) {
getRenderer().fillRangeGridBand(g2, this, axis, dataArea,
previous, current);
}
previous = current;
fillBand = !fillBand;
}
double end = axis.getUpperBound();
if (fillBand) {
getRenderer().fillRangeGridBand(g2, this, axis, dataArea,
previous, end);
}
}
}