How to make MPAndroidChart RadarChart round - java

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.

Related

Android Mapbox with clustering I want each feature to have different marker image

We are implementing clustering on my app. Until now we were using the addMarker method to add the markers, but now with clustering it seems that we should add them by using addSource.GeoJsonSource which we give a feature collection with all the points. With this new implementation, we are having problem giving different markers different images. We would appreciate if somebody could help.
The solution to this is not necessarily to add a new source.
You can associate multiple images with a style and use a styling expression to determine which clusters use which images. As is done in this example: https://docs.mapbox.com/android/maps/examples/symbol-layer-clustering/
⚠️ Disclaimer: I currently work at Mapbox ⚠️

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

linePlusBarChart in NVD3, rCharts and shiny

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!

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.

Drag and Drop and identify locations with java

I'm trying to do something quite simple, but I'm having a hard time finding good examples on the net to what I want specifically.
I'd like to somehing very similer to what it's here:
Dao
It's a simple game called DAO and I just need to have a background image with 16 squares (4x4) and drag and drop the images (pieces) on each square to the others. I'm developing the interface using swing and I simply want to know a good place to find tutorials for such implementations or a simple suggestion on how to do it.
Thanks in advance
Shameless plug:
have a look at my simple example via my google project
http://code.google.com/p/jchronos/
There is code to drag list item across list boxes. Same should be applicable to JLabel
Look at sources
http://code.google.com/p/jchronos/source/browse/trunk/src/org/jchronos/ui/QuadrantPanel.java
http://code.google.com/p/jchronos/source/browse/trunk/src/org/jchronos/ui/ArrayListTransferHandler.java

Categories

Resources