Dashboard Examples - Samples - Tutorials


Dashboard Digest - Shared Knowledge from all Dashboard Experts

Hello and welcome to the Dashboard Digest. There are so many wonderful digital dashboard related websites (dashboardspy, dashboardinsight, dashboardzone to name a few) including some vendor specific blogs. This website serves to be just a digest for all the dashboard content. If you would like to include your blog as part of this digest please email us a link. (dashboard.kpi"AT"gmail"dot"com).
NOTE:Please make sure your RSS feeds is set to show only excerpts. Please do not ask us to include your blog if your RSS feeds is showing the full article instead of snippets.. If you are using Wordpress, you can change your RSS feed settings by going to Reading Settings and change the RSS to show only summary.
RSS Subscribe to RSS

Interval Marker | Set Goal or Target line in Bar Chart

Interval Marker is a special feature that allows you set targets or reference point for your bar or line charts.

Here is a basic bar chart

Image

To add a reference line or interval marker as below

Image

Use the following code for the javascript

//import the necessary classes
import org.jfree.*;
import org.jfree.chart.axis.CategoryAxis;
//import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.axis.NumberAxis;
//import org.jfree.chart.labels.CategoryItemLabelGenerator;
//import org.jfree.chart.labels.StandardCategoryItemLabelGenerator;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PiePlot3D;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.category.BarRenderer;
import org.jfree.chart.renderer.category.BarRenderer3D;
//import org.jfree.chart.renderer.category.CategoryItemRenderer;
//import org.jfree.chart.renderer.category.LineAndShapeRenderer;
import org.jfree.ui.GradientPaintTransformType;
import org.jfree.ui.StandardGradientPaintTransformer;
import org.jfree.chart.plot.IntervalMarker;
import org.jfree.ui.Layer;

import org.jfree.ui.RectangleAnchor;
import org.jfree.ui.RefineryUtilities;
import org.jfree.ui.TextAnchor;

BarRenderer barRenderer = (BarRenderer)plot.getRenderer();
barRenderer.setDrawBarOutline(false);


IntervalMarker target = new IntervalMarker(70000,75000);
target.setLabelFont(new Font(”SansSerif”, Font.ITALIC, 11));
target.setLabelAnchor(RectangleAnchor.LEFT);
target.setLabelTextAnchor(TextAnchor.CENTER_LEFT);
plot.addRangeMarker(target, Layer.BACKGROUND);

ShareThis

Read More


Sorry, comments for this entry are closed at this time.


Corptheme by Free WordPress Themes  Yoga for health