MPAndroidChart bar chart takes full width if one value is to large - android

I am using MPAndroidChart in one of my projects, i am using horizontal bar charts. Several times if the value of 1 filed it too large the graph kind of shows only that value and rest all other values becomes 0.
Now i understand this is correct behavior since it calculate percentage and divide the values but even in those cases this values should be shown. Is there any way to achieve this ??
Here is what it looks like :
Value of all other fields are pretty small less than 2000 !!

As it is clearly visible in the screenshot you provided, the values are shown. They are just very small (exactly as small as you set them to be) and therefore they are not drawn any bigger on the chart.
I honestly don't know what you expect?
If you want the bars of the small values to be "bigger", then use bigger values.
Something like a logarithmic scale is not yet available for the axes.

In MP Android chart there is no way to handle this issue of 'one-value-is-too-large'. I faced this issue and had to implement a design change. In my chart most values were of range 10 units and only one value was very large around 4000 units. So I decide to not display the large value in chart and display it below the chart. Here is an image view

Related

MPAndroidChart: make candlestick yVals relative to the data

I am using MPAndroidChart. My app shows some market exchange data, and I need it to display the values the way every rise and dip should be noticed. That's how some data looks like now:
You can see that all values except the first one are displayed like dots as they're too small relative to the first one. What I want it to be is like this:
Here the yValues notice the difference between market values and adjust accordingly. Anyway I could do like that? Thanks in advance!

Near and large values overlaps each others in line chart

Thank you for this powerful library.
I have a problem when the values are near to each other and every value has several amount of digits, the value would overlap each others like in the below snapshot.
I tried to make some values upper and some lower the line, or to make values written in vertical way (like x labels in the snapshot), but I didn't find way to do that.
If there is any advice or other workaround, it will be appreciated.
Snapshot is in the link below
Image Shows the problem

loading an image, is the width/height pixel count maintained

I have read all about supporting different screens and I understand the concept of Density Pixels (DP). However one thing I am not sure about. Lets say I have an image file which is 200 by 200 pixels and I loaded it using xml with wrap_content attributes at the top left of the screen (0,0). Now let's say I want to place a textview programmatically beside it.
If I put the text view at coordinates (250,0). Does that mean that the text view will never overlap the image and will always be to the right no matter what the device density/screen size is.
I understand the distance ( gap) will be different but I am hoping my theory of not overlapping will hold.
I tried it on 2 device and no issues but I am not sure if this is coincendence
Thanks
If you are using px unit it will always remain the same. But if you are using dp unit instead of pixel you cannot definitely be sure.
By the way you should use toRightOf property instead of this approach if you only want this.

MPAndroidChart. Can't force labels to have an equal spacing

I'm using MPAndroidChart library and can't make labels to have an equal spacing.
When setAvoidFirstLastClipping(false) I get this:
As you can see only label 1 has shifted, others two didn't move a bit.
I also played with getXAxis().setSpaceBetweenLabels(10); The best outcome was:

Dynamic Android Layout Scaling (How-To?)

I'm stuck and I think wisdom (aka experience) is the only solution.
I need to be able to have boxes on a screen with data inside each box. The number of boxes on the screen needs to be able to change and the boxes need to scale accordingly (as well as the text data inside of them) to allow for the additional boxes.
Example: I might start with only 8 boxes which are evenly spaced and displaying data at a reasonable font scale.
As I add more boxes I need the rest of the boxes to scale down and allow everything on one screen.
I am currently attempting to use a TableLayout, but I'm not certain how to make everything scale correctly. Also, I'm generating everything programmatically by extending the TableLayout. Can someone point me in the right direction. Is there a better layout method that I'm not seeing? I'm sure I'm not the first person to need this, so are there examples available that I'm just not finding by searching?
The eventual solution was to build my own scaling function which took screen pixel dimensions and calculated the appropriate margin offsets to use on a relative layout. It requires a complete redraw each time the scaling factor changes, which is annoyingly resource intensive.

Categories

Resources