linePlusBarChart in NVD3, rCharts and shiny - java

There exists an NVD3 chart for combining a line and bar chart, linePlusBarChart. This would suit my data very well. However, it does not seem to be supported natively with rCharts. As far as I can see, the NVD3 charts which are implemented in rCharts are (from examples):
scatterChart
multiBarChart
multiBarHorizontalChart
pieChart
lineChart
lineWithFocusChart
stackedAreaChart
Is it possible to get other ones to work? It may be that I have misunderstood the structure of rCharts+NVD3! I'm quite new to Java, so I would be very grateful for good references, documentation, and general help!
But my basic and immediate question is: How to get a linePlusBarChart from rCharts? Or a way to layer a lineChart onto a bar chart?
Thanks!

Related

How to make MPAndroidChart RadarChart round

I would like to present some Values inside a Radar Chart.
Long-time I was working with AndroidPlot which works great but it doesn't support Radar charts.
So I swapped to MPAndroidCharts.
But MPCharts only supports angular RadarCharts by default.
I found the following Link in the Issues, but there is no Code given
https://github.com/PhilJay/MPAndroidChart/issues/1446
Another Stack Overflow Entry I found is this, but I can't combine it with MPAndroid Charts
Radar Chart for Android
At the Android Charts Library:
https://github.com/limccn/Android-Charts
rounded Charts are mentioned, but I can't find the according Class in Code
Is there already a solution to make MPAndroidCharts RadarCharts round,
or any other Library that supports rounded RadarCharts.
Thanks for Help
go to RadarChartRenderer class.
and edit the method inside class like below:
protected void drawDataSet(Canvas c, IRadarDataSet dataSet, int mostEntries) {
..........................
..........................
mRenderPaint.setStrokeWidth(dataSet.getLineWidth());
mRenderPaint.setStyle(Paint.Style.STROKE);
mRenderPaint.setDither(true);
mRenderPaint.setStrokeJoin(Paint.Join.ROUND);
mRenderPaint.setStrokeCap(Paint.Cap.ROUND);
mRenderPaint.setPathEffect(new CornerPathEffect(30) );
mRenderPaint.setAntiAlias(true);
............................
............................
}
my results like:
As mention in the issue link, you can implement it by yourself, just see https://github.com/PhilJay/MPAndroidChart/blob/c1f6fcebf0c3516e067b34312b283189f909bde5/MPChartLib/src/main/java/com/github/mikephil/charting/charts/RadarChart.java as a reference,
write your RoundRadarChart class to extend the RadarChart
write your RoundRadarChartRenderer, YAxisRendererRoundRadarChart and XAxisRendererRoundRadarChart to extend the RadarChart ones, mainly you should to override the drawXXX functions
use your new renderer classes in your chart class to replace the RadarChart renderers
You need to re-caculate the factory of drawing lines, points and labels
And about the Android-Charts project, you may have a look at https://github.com/limccn/Android-Charts/tree/master/src/src/cn/limc/androidcharts/view. Not sure if the RoundChart is what you want.

Does JFreeChart support this type of bar chart?

I need to render a chart like this:
NOTE: I don't need the average lines, just the basic layout.
I need to specify a few key groups ("Bill Clinton", "Ronald Reagan" etc. in this example) and then assign any number of sub-keys to each group (years in the example provided). Can it be done in JFreeChart? Thanks.
You can't do the subgrouping on the axis without writing a custom subclass of CategoryAxis. Everything else can be handled with the existing API.
As per the examples on the site, I'd say yes. By combining a labelled line chart (as with Line Chart Demo 5 on their online demo) and a bar (any bar chart demo) chart plot into a dual axis plot (dual axis demo 1 below).
In fact, Overlaid Bar Chart Demo 1 and Overlaid Bar Chart Demo 2 combined are pretty much exactly what you want.
http://www.jfree.org/jfreechart/samples.html
If you go to this link:
JFreeChart showcase jar
you can download a jar file which will launch via JNLP (Java network launcher protocol) This will showcase a large range of charts that can be created with JFree, including bar charts. I believe it contains proof that charts similar to what you desire can be made.
NOTE: You may need to tweak your security settings to run the jar file
Good luck!
I think it should work see this image is created with JFreeChart

Creating a datatable in JavaFx

i want to create a table that is connected with my chart the idea is that it display the information on the chart in details.
here is a picture i found to give you an idea of how it should be builded (however i want the graph to be made in JavaFx and therefore the graph and table it self should be more smooth and with better graphics):
As you can see on the picture the information under for day (D1,D2,D3) is displayed right under the bars. how would i create a similar thing in JavaFx?

How to combine AreaChart and LineChart with gwt-visualizations

I have a vaadin project where I use visualizations-for-vaadin addon, which is a wrapper for gwt-visualizations. What I need is an AreaChart with stacked areas and one reference line on it. So kind of combination of an AreaChart and a LineChart. I understood, that if I want to achieve this, I have to write/extend my own AreaLineChart. Can somebody point me into the right solution how to do it? I am browsing through the visualizations code, but still cannot find out how to do it.
The specs for the chart would be something like this:
class AreaLineChart {
public void addArea(...);
public void add(....);
// this is the new method I need in the area chart
public void addLine(....);
}
Thank you,
Filip
If you would consider switching charting packages, the Invient charts addon is a wrapper for the High Charts package, which is very pretty looking. Conveniently, it already wraps the combo chart for you. See the demo here and click on the combination charts at the bottom.
Use an AreaChart where you can define areaOpacity to 0 for drawing a line.
But for this you need to use the "series" option.

Selecting a curve in jFreechart

I have several time series plotted with jfreechart. The graph also contains multiple annotations. I want the user to be able to select the time series or the annotations.
So far I have tried: entityCollection.getEntity(x,y) which returns me the PlotEntity and panel.getComponentAt(x,y) which gives me the chart panel.
so my question is: can jFreechart provide me with this information?
You can add a ChartMouseListener, as shown here. The ChartMouseEvent will indicate which ChartEntity subclass was found.

Categories

Resources