Is there a way to only show the custom Y Grid
Since mRenderer.setSHowCustomTextGrid accepts only one parameter I don;t know how to set this.
How it is now:
How I want it:
I added the APIs you need in SVN. You can download a version including this feature here.
Related
I need to create a SeekBarPreference with 2 thumbs (min/max functionality).
There are very, very little resources to find on this - mostly just old broken libraries.
I'd like to implement my own. The backend functionality is not a problem - my problem is trying to create the xml widget. Initially I tried to overlay 2 SeekBars on top of eachother but it doesn't seem feasible as only one can be changed at a time.
I'm after direction/a set of steps to implement this RangeBar as there is quite a lot to take on.
Alternatively if there are any current libraries with 2-thumb widget, that are compatible with AndroidX, that would be appreciated.
Please refer below link :
https://github.com/syedowaisali/crystal-range-seekbar
Using this crystal range seekbar library you can modify the seekbar as per your requirements like single thumb or two thumbs and also modify the theme.
<com.crystal.crystalrangeseekbar.widgets.CrystalRangeSeekbar
android:id="#+id/PriceRangeSeekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_10ssp"
app:bar_color="#dddddd"
app:bar_highlight_color="#color/colorPrimary"
app:corner_radius="1"
app:data_type="_integer"
app:left_thumb_color="#color/white"
app:left_thumb_image="#drawable/ic_thumb"
app:max_value="500"
app:min_value="50"
app:right_thumb_color="#color/white"
app:right_thumb_image="#drawable/ic_thumb"
app:steps="50" />
I am using the latest MPAndroidChart library, and I was wondering if there is way to set a dual-background color on the chart. I need the colors to match a certain number of days that will be displayed on the x-axis. I would like to be able to do this programmatically as I will be using real time data, so the background will be set to a certain no. of days and move along as the chart is updated.
I think you will have to programmatically create a bitmap that always changes according to the latest realtime data you get. Then, you use that Bitmap and set it as the chart-background.
There is no way to set a specific background color (or multiple) in the way you describe it other than via the methods and ways the View class itself already provides.
In order to get the style that I wanted I downloaded the source-code and edited it to allow me to add a Bitmap image to the graph background. So now the background is redrawn when new data is entered and then added to the graph background so that it looks like the date is linked to the background color. Thanks again to Philipp Jahoda for the brilliant library and thank god for open source developers.
p.s if I ever get rich off of this app I will look after you.
How do I display values on top of a bar chart using the shinobi library in android
The AnnotationsManager, specifically the addTextAnnotation method, is the solution that you are looking for. You can use this method to add any string to the chart at any X and Y position, in terms of data.
There is a How-To guide about Annotations at the ShinobiControls website. This How-To guide, along with an accompanying sample app, is also included in the download bundle.
Disclaimer: I work for ShinobiControls.
I realise AndroidPlot has a forum but it isn't the most active so i'll chance my arm here...
I'm trying to remove the series indicator or plot legend from my XY plot using the AndroidPlot library. I don't want to remove the series from the plot itself, just the legend.
I've seen it done on AndroidPlot examples but with the limited documentation it's difficult to find methods to do the stuff like remove the legen
OK I have the following code to do this. This is not tested on the very latest version but hopefully is still good.
if (!mKeyOn)
mDynamicPlot.getLayoutManager()
.remove(mDynamicPlot.getLegendWidget());
if (!mDomainLabelOn)
mDynamicPlot.getLayoutManager().remove(
mDynamicPlot.getDomainLabelWidget());
Looks like the trick is to get the layoutManager.
You can also use Androidplot's XML Styling with Configurator and thanks to reflection remove plot legend by simply specifying it's visibility in XML layout file like this:
<com.androidplot.xy.XYPlot
...
androidPlot.legendWidget.visible="false"
... />
If there is no need to change your legend dynamically, I think it's better to place such a styling in the XML file.
Looking at the code, setLegendWidget only updates the local handle for the LegendWidget but does not update the LayoutManager, which is what is actually invoked when it comes time to do the drawing. If you implement Ifor's (upvoted) suggestion you should have success since it interacts with the LayoutManager directly:
plot.getLayoutManager().remove(plot.getDomainLabelWidget());
Another option is to hide the Legend like this:
plot.getLegendWidget().setVisible(false);
Provided (in light of the info above) that you are not also trying to substitute/remove the legend widget with a previous call to setLegendWidget().
If you want to remove only one (or a specific) series legend from the legend widget simply use:
yourSeriesFormater.setLegendIconEnabled(false);
This worked for me.
I want to add line chart in my application , which has two view 1st view is image 2nd view is line chart, i want to add x values dynamically chart has to grow after adding each x values.
please suggest some link or code.
I don't fully understand the issue of 2 views in the question. What should the image represent ? How is it related to the chart ?
As for rest (i.e. having a dynamic line chart) - I have successfully achieved that with the AndroidPlot library (http://androidplot.com/), and I think it might do the trick for you.
I use Jonas's GrapView lib to show charts. Take a look on this lib, it very simple and easy to use. He shows ho to use it with a lot of example.
Good Luck!