本文整理匯總了Java中org.jfree.chart.plot.CategoryPlot.getDomainAxisForDataset方法的典型用法代碼示例。如果您正苦於以下問題:Java CategoryPlot.getDomainAxisForDataset方法的具體用法?Java CategoryPlot.getDomainAxisForDataset怎麽用?Java CategoryPlot.getDomainAxisForDataset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.plot.CategoryPlot
的用法示例。
在下文中一共展示了CategoryPlot.getDomainAxisForDataset方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: calculateBarWidth
import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
* Calculates the bar width and stores it in the renderer state.
*
* @param plot the plot.
* @param dataArea the data area.
* @param rendererIndex the renderer index.
* @param state the renderer state.
*/
protected void calculateBarWidth(CategoryPlot plot,
Rectangle2D dataArea,
int rendererIndex,
CategoryItemRendererState state) {
// calculate the bar width
CategoryAxis xAxis = plot.getDomainAxisForDataset(rendererIndex);
CategoryDataset data = plot.getDataset(rendererIndex);
if (data != null) {
PlotOrientation orientation = plot.getOrientation();
double space = 0.0;
if (orientation == PlotOrientation.HORIZONTAL) {
space = dataArea.getHeight();
}
else if (orientation == PlotOrientation.VERTICAL) {
space = dataArea.getWidth();
}
double maxWidth = space * getMaxBarWidth();
int columns = data.getColumnCount();
double categoryMargin = 0.0;
if (columns > 1) {
categoryMargin = xAxis.getCategoryMargin();
}
double used = space * (1 - xAxis.getLowerMargin() - xAxis.getUpperMargin()
- categoryMargin);
if (columns > 0) {
state.setBarWidth(Math.min(used / columns, maxWidth));
}
else {
state.setBarWidth(Math.min(used, maxWidth));
}
}
}
示例2: calculateBarWidth
import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
* Calculates the bar width and stores it in the renderer state.
*
* @param plot the plot.
* @param dataArea the data area.
* @param rendererIndex the renderer index.
* @param state the renderer state.
*/
protected void calculateBarWidth(CategoryPlot plot,
Rectangle2D dataArea,
int rendererIndex,
CategoryItemRendererState state) {
// calculate the bar width
CategoryAxis xAxis = plot.getDomainAxisForDataset(rendererIndex);
CategoryDataset data = plot.getDataset(rendererIndex);
if (data != null) {
PlotOrientation orientation = plot.getOrientation();
double space = 0.0;
if (orientation == PlotOrientation.HORIZONTAL) {
space = dataArea.getHeight();
}
else if (orientation == PlotOrientation.VERTICAL) {
space = dataArea.getWidth();
}
double maxWidth = space * getMaximumBarWidth();
int columns = data.getColumnCount();
double categoryMargin = 0.0;
if (columns > 1) {
categoryMargin = xAxis.getCategoryMargin();
}
double used = space * (1 - xAxis.getLowerMargin()
- xAxis.getUpperMargin()
- categoryMargin);
if (columns > 0) {
state.setBarWidth(Math.min(used / columns, maxWidth));
}
else {
state.setBarWidth(Math.min(used, maxWidth));
}
}
}
示例3: calculateBarWidth
import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
* Calculates the bar width and stores it in the renderer state. We override the method in
* the base class to take account of the series-->group mapping.
*
* @param plot the plot.
* @param dataArea the data area.
* @param rendererIndex the renderer index.
* @param state the renderer state.
*/
protected void calculateBarWidth(CategoryPlot plot,
Rectangle2D dataArea,
int rendererIndex,
CategoryItemRendererState state) {
// calculate the bar width
CategoryAxis xAxis = plot.getDomainAxisForDataset(rendererIndex);
CategoryDataset data = plot.getDataset(rendererIndex);
if (data != null) {
PlotOrientation orientation = plot.getOrientation();
double space = 0.0;
if (orientation == PlotOrientation.HORIZONTAL) {
space = dataArea.getHeight();
}
else if (orientation == PlotOrientation.VERTICAL) {
space = dataArea.getWidth();
}
double maxWidth = space * getMaxBarWidth();
int groups = this.seriesToGroupMap.getGroupCount();
int categories = data.getColumnCount();
int columns = groups * categories;
double categoryMargin = 0.0;
double itemMargin = 0.0;
if (categories > 1) {
categoryMargin = xAxis.getCategoryMargin();
}
if (groups > 1) {
itemMargin = getItemMargin();
}
double used = space * (1 - xAxis.getLowerMargin() - xAxis.getUpperMargin()
- categoryMargin - itemMargin);
if (columns > 0) {
state.setBarWidth(Math.min(used / columns, maxWidth));
}
else {
state.setBarWidth(Math.min(used, maxWidth));
}
}
}
示例4: calculateBarWidth
import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
* Calculates the bar width and stores it in the renderer state. We
* override the method in the base class to take account of the
* series-to-group mapping.
*
* @param plot the plot.
* @param dataArea the data area.
* @param rendererIndex the renderer index.
* @param state the renderer state.
*/
protected void calculateBarWidth(CategoryPlot plot,
Rectangle2D dataArea,
int rendererIndex,
CategoryItemRendererState state) {
// calculate the bar width
CategoryAxis xAxis = plot.getDomainAxisForDataset(rendererIndex);
CategoryDataset data = plot.getDataset(rendererIndex);
if (data != null) {
PlotOrientation orientation = plot.getOrientation();
double space = 0.0;
if (orientation == PlotOrientation.HORIZONTAL) {
space = dataArea.getHeight();
}
else if (orientation == PlotOrientation.VERTICAL) {
space = dataArea.getWidth();
}
double maxWidth = space * getMaximumBarWidth();
int groups = this.seriesToGroupMap.getGroupCount();
int categories = data.getColumnCount();
int columns = groups * categories;
double categoryMargin = 0.0;
double itemMargin = 0.0;
if (categories > 1) {
categoryMargin = xAxis.getCategoryMargin();
}
if (groups > 1) {
itemMargin = getItemMargin();
}
double used = space * (1 - xAxis.getLowerMargin()
- xAxis.getUpperMargin()
- categoryMargin - itemMargin);
if (columns > 0) {
state.setBarWidth(Math.min(used / columns, maxWidth));
}
else {
state.setBarWidth(Math.min(used, maxWidth));
}
}
}