Package com.positive.charts.legend

Examples of com.positive.charts.legend.LegendItem


    for (int s = 0; s < this.sources.length; s++) {
      final LegendItemCollection legendItems = this.sources[s]
          .getLegendItems();
      if (legendItems != null) {
        for (int i = 0; i < legendItems.getItemCount(); i++) {
          final LegendItem item = legendItems.get(i);
          final Block block = this.createLegendItemBlock(item);
          this.items.add(block);
        }
      }
    }
View Full Code Here


        if (renderer != null) {
          final int seriesCount = dataset.getSeriesCount();
          for (int i = 0; i < seriesCount; i++) {
            if (renderer.isSeriesVisible(i)
                && renderer.isSeriesVisibleInLegend(i)) {
              final LegendItem item = renderer.getLegendItem(
                  datasetIndex, i);
              if (item != null) {
                result.add(item);
              }
            }
View Full Code Here

   *            the series index (zero-based).
   *
   * @return A legend item for the series.
   */
  public LegendItem getLegendItem(final int datasetIndex, final int series) {
    LegendItem result = null;
    final XYPlot xyplot = this.getPlot();
    if (xyplot != null) {
      final XYDataset dataset = xyplot.getDataset(datasetIndex);
      if (dataset != null) {

        final String label = this.legendItemLabelGenerator
            .generateLabel(dataset, series);
        final String description = label;
        String toolTipText = null;
        if (this.getLegendItemToolTipGenerator() != null) {
          toolTipText = this.getLegendItemToolTipGenerator()
              .generateLabel(dataset, series);
        }
        String urlText = null;
        if (this.getLegendItemURLGenerator() != null) {
          urlText = this.getLegendItemURLGenerator().generateLabel(
              dataset, series);
        }
        final Rectangle shape = this.lookupSeriesShape(series);
        final Color paint = this.getSeriesPaint(series);
        final Color outlinePaint = this
            .lookupSeriesOutlinePaint(series);
        final Stroke outlineStroke = this
            .lookupSeriesOutlineStroke(series);
        result = new LegendItem(label, description, toolTipText,
            urlText, shape, paint, outlineStroke, outlinePaint);
        result.setSeriesKey(dataset.getSeriesKey(series));
        result.setSeriesKey(dataset.getSeriesKey(series));
        result.setSeriesIndex(series);
        result.setDataset(dataset);
        result.setDatasetIndex(datasetIndex);
      }
    }
    return result;
  }
View Full Code Here

    final XYDataset dataset = this.plot.getDataset(index);
    if (dataset != null) {
      final int seriesCount = dataset.getSeriesCount();
      for (int i = 0; i < seriesCount; i++) {
        if (this.isSeriesVisibleInLegend(i)) {
          final LegendItem item = this.getLegendItem(index, i);
          if (item != null) {
            result.add(item);
          }
        }
      }
View Full Code Here

          final CategoryItemRenderer renderer = this
              .getRenderer(datasetIndex);
          if (renderer != null) {
            final int seriesCount = dataset.getRowCount();
            for (int i = 0; i < seriesCount; i++) {
              final LegendItem item = renderer.getLegendItem(
                  datasetIndex, i);
              if (item != null) {
                result.add(item);
              }
            }
View Full Code Here

    // Color.black);

    final Color legentItemLinePaint = this.getPlot().getDrawingAssets()
        .getColor(Plot.DEFAULT_LEGEND_ITEM_LINE_COLOR);

    final LegendItem item = new LegendItem(label, description, toolTipText,
        urlText, true, shape, true, paint, true, outlinePaint,
        outlineStroke, false, LegendItem.UNUSED_SHAPE,
        LegendItem.UNUSED_STROKE, legentItemLinePaint);

    item.setSeriesIndex(series);
    item.setDatasetIndex(datasetIndex);
    return item;
  }
View Full Code Here

    final CategoryDataset dataset = this.plot.getDataset(index);
    if (dataset != null) {
      final int seriesCount = dataset.getRowCount();
      for (int i = 0; i < seriesCount; i++) {
        if (this.isSeriesVisibleInLegend(i)) {
          final LegendItem item = this.getLegendItem(index, i);
          if (item != null) {
            result.add(item);
          }
        }
      }
View Full Code Here

          final Color Color = this.lookupSectionPaint(key, true);
          final Color outlinePaint = this
              .lookupSectionOutlinePaint(key);
          final Stroke outlineStroke = this
              .lookupSectionOutlineStroke(key);
          final LegendItem item = new LegendItem(label, description,
              toolTipText, urlText, true, shape, true, Color,
              true, outlinePaint,
              outlineStroke,
              false, // line
              // not
              // visible
              new Rectangle(0, 0, 0, 0), new Stroke(1),
              StaticColorChecker.dublicateColor(SWT.COLOR_BLACK));
          // Display
          // .getDefault().getSystemColor(
          // SWT.COLOR_BLACK));
          item.setDataset(this.getDataset());
          result.add(item);
        }
        section++;
      } else {
        section++;
View Full Code Here

    final Stroke outlineStroke = this.getSeriesOutlineStroke(series);

    final Color legendItemLineColor = this.getPlot().getColor(
        Plot.DEFAULT_LEGEND_ITEM_LINE_COLOR);

    return new LegendItem(label, description, toolTipText, urlText, true,
        shape, true, paint, this.isDrawBarOutline(), outlinePaint,
        outlineStroke, false, new Rectangle(0, 0, 0, 0), new Stroke(1),
        legendItemLineColor);
  }
View Full Code Here

TOP

Related Classes of com.positive.charts.legend.LegendItem

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.