Package com.positive.charts.axis

Examples of com.positive.charts.axis.CategoryAxis


   *            the dataset index.
   *
   * @return The domain axis.
   */
  public CategoryAxis getDomainAxisForDataset(final int index) {
    CategoryAxis result = this.getDomainAxis();
    final Integer axisIndex = (Integer) this.datasetToDomainAxisMap
        .get(index);
    if (axisIndex != null) {
      result = this.getDomainAxis(axisIndex.intValue());
    }
View Full Code Here


      final int index, final PlotRenderingInfo info) {

    boolean foundData = false;
    final CategoryDataset currentDataset = this.getDataset(index);
    final CategoryItemRenderer renderer = this.getRenderer(index);
    final CategoryAxis domainAxis = this.getDomainAxisForDataset(index);
    final ValueAxis rangeAxis = this.getRangeAxisForDataset(index);
    final boolean hasData = !DatasetUtilities.isEmptyOrNull(currentDataset);
    if (hasData && (renderer != null)) {

      foundData = true;
View Full Code Here

   * @param notify
   *            notify listeners?
   */
  public void setDomainAxis(final int index, final CategoryAxis axis,
      final boolean notify) {
    final CategoryAxis existing = (CategoryAxis) this.domainAxes.get(index);
    if (existing != null) {
      existing.removeChangeListener(this);
    }
    if (axis != null) {
      axis.setPlot(this);
    }
    this.domainAxes.set(index, axis);
View Full Code Here

   *
   * @return A domain axis.
   */
  protected CategoryAxis getDomainAxis(final CategoryPlot plot,
      final int index) {
    CategoryAxis result = plot.getDomainAxis(index);
    if (result == null) {
      result = plot.getDomainAxis();
    }
    return result;
  }
View Full Code Here

   */
  protected void calculateBarWidth(final CategoryPlot plot,
      final Rectangle dataArea, final int rendererIndex,
      final CategoryItemRendererState state) {

    final CategoryAxis domainAxis = this.getDomainAxis(plot, rendererIndex);
    final CategoryDataset dataset = plot.getDataset(rendererIndex);
    if (dataset != null) {
      final int columns = dataset.getColumnCount();
      final int rows = dataset.getRowCount();
      double space = 0.0;
      final PlotOrientation orientation = plot.getOrientation();
      if (orientation == PlotOrientation.HORIZONTAL) {
        space = dataArea.height;
      } else if (orientation == PlotOrientation.VERTICAL) {
        space = dataArea.width;
      }
      final double maxWidth = space * this.getMaximumBarWidth();
      double categoryMargin = 0.0;
      double currentItemMargin = 0.0;
      if (columns > 1) {
        categoryMargin = domainAxis.getCategoryMargin();
      }
      if (rows > 1) {
        currentItemMargin = this.getItemMargin();
      }
      final double used = space
          * (1 - domainAxis.getLowerMargin()
              - domainAxis.getUpperMargin() - categoryMargin - currentItemMargin);
      if ((rows * columns) > 0) {
        state.setBarWidth(Math.min(used / (rows * columns), maxWidth));
      } else {
        state.setBarWidth(Math.min(used, maxWidth));
      }
View Full Code Here

TOP

Related Classes of com.positive.charts.axis.CategoryAxis

Copyright © 2018 www.massapicom. 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.