How to synchronize TimeSeries colour with Marker colour in JFreeChart? - jfreechart

I am displaying several time series lines along with Markers on a JFreeChart plot. Different markers are related to different time series and I would like them to appear in the same colour. So how do I find out for a given TimeSeries what is colour is?

You should be able to use lookupSeriesPaint() for a given series. See also this example that overrides getItemPaint(), which calls lookupSeriesPaint().

Related

Lightview chart histogram like Highcharts Stacked bar

Is there any way I can make a Lightview histogram chart with multiple values per data point, so that it looks like a Highchart stacked bar (https://www.highcharts.com/demo/bar-stacked)?
If not, is there a workaround?
I already overlay-ed two separate histograms, but that does not help, because both start at the bottom and depending on the values some points are hidden.
Unfortunately it's not possible to draw vertical histogram at the moment.

Same data looks different in time-series line chart and bar chart

Im showing identical data in two different charts:
But for some reason all bar charts show different time series for the graph. It should start from Mar.25 and end Apr.9
You might try looking at the style tab for the charts and selecting the correct range setting on the x axis.

Create forest plot using JFreeChart

Does anyone have an example of how to render a forest plot using JFreeChart (or another Java-based open source charting library, but JFreeChart is preferred due to the integration with Jasper Reports)?
See https://en.wikipedia.org/wiki/Forest_plot for description of the forest plot.
I was thinking about hacking somethign together using a horizontal bar chart where left side of the axis is the categorical value, and right side is the range, but the problem is the data for a forest plot comes in a set of data like: category, min, max. Such as an odd ratio with a confidence interval that spans between -.1 to 1.2. The forrest plot would basically be a line drawn between -.1 and 1.2 with a diamond marker directly in the middle (around .55).
If anyone has experience on building this visualization in JFreeChart, it would be much appreciated!
While this is not supported directly in the current release, a reasonable facsimile should be possible. Instead of a bar chart, consider using a MinMaxCategoryRenderer having PlotOrientation.HORIZONTAL and custom icons, as shown here. Add a CategoryMarker or CategoryLineAnnotation with a dashed Stroke to the CategoryPlot for the centerline; add a CategoryItemLabelGenerator to handle the labels.

SSRS bar chart issue

I am trying to add one box and one line on x-axis. Please look at below bar chart.
I tried using stripline but I cannot set height for stripline. It goes till 100.
Is there any way I can do this?
Unfortunately, SSRS doesn't provide the functionality you're looking for. A stripline is the closest you can get to that, but like you said, you can't control its height. The only way you could simulate this behavior would be to use a Background Image for your stripline, but that may be more work than it's worth. It would require a lot of manual adjustment to get the image to line up on the chart.
I would add a series to the chart using the Stock chart (under Range). In the Series Properties I would set the High value to the height desired for your line (~52 in your example). Ideally this would come from a dataset value.
Set the Low, Open and Close values to 0.
Try two Stripe Lines. First, create the strip line which represents the vertical value you're after. In my case, I made one that was 50% of the graph height off of the Y-Axis.
Chart Properties:
Height of StripeLine:
Once the stripe line is the correct height for the chart, create a 'mask' stripe line along the X-axis that will cover the portion of the Y-axis line you want hidden.
Chart Propterites:
Width of Stripe Mask:
Using these methods, and some really clever expression writing, you should be able to make the line exactly as high, and as wide as you desire.

Silverlight toolkit chart too many labels on axis

I'm using the newest chart control from silverlight toolkit to plot some data. For small cases it works ok, but for bigger samples the X axis labels overlap. It would be no problem if the chart would simply omit some of the values or I could specify to just show every 10th of them ...
I couldn't find any properties providing this behavior. Any ideas?
Assuming this is a Linear axis then you can specify the interval to use via the the Interval property on the axis.
If the axis in question is Category Axis then dropping some labels may not be valuable to the user. One option is to use the LayoutTransfomer to rotate the labels to an angle reducing the width needed for each one. See this Delay Blog on the subject.

Resources