Comments (6)
Hello,
Thank you for using this library,
You can see from the code below that app:hdEmptyColor="@color/empty"
has an empty color
which it's nothing more than the transparent android color @android:color/transparent
, you can change this empty color and you will get something like the image above.
Also don't forget to specify the max number.
<com.hadiidbouk.charts.ChartProgressBar
android:id="@+id/ChartProgressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
app:hdBarCanBeClick="true"
app:hdBarHeight="170dp"
app:hdBarWidth="7dp"
app:hdBarRadius="10dp"
app:hdMaxValue="10"
app:hdEmptyColor="@color/empty"
app:hdProgressColor="@color/progress"
app:hdProgressClickColor="@color/progress_click"
app:hdPinBackgroundColor="@color/pin_background"
app:hdPinTextColor="@color/pin_text"
app:hdPinPaddingBottom="5dp"
app:hdBarTitleColor="@color/bar_title_color"
app:hdBarTitleTxtSize="12sp"
app:hdPinTxtSize="17sp"
app:hdPinMarginTop="10dp"
app:hdPinMarginBottom="55dp"
app:hdPinMarginEnd="22dp"
app:hdBarTitleMarginTop="9dp"
app:hdPinDrawable="@drawable/ic_pin"
app:hdProgressDisableColor="@color/progress_disable"
app:hdBarTitleSelectedColor="@color/bar_title_selected_color"/>
from chartprogressbar-android.
Hi, @hadiidbouk thanks for quick reply. as I can see when I set max value app:hdMaxValue="10"
. It sets for all the chart bars. Is it possible that I can set the max value for every chart bar separately?
from chartprogressbar-android.
You are welcome, Unfortunately this feature isn't available, you can add maxValue
to the BarData
and then in the build()
function you can use this value, I will be appreciated if you send me a PR 👍
from chartprogressbar-android.
BarData.class
public class BarData {
private String barTitle;
private float barValue;
private String pinText;
private float maxValue = 0.0f;
...
}
Updated mMaxValue in build
addView(linearLayout);
int i = 0;
for (BarData data : mDataList) {
int barValue = (int) (data.getBarValue() * 100);
mMaxValue = data.getMaxValue();
FrameLayout bar = getBar(data.getBarTitle(), barValue, i);
linearLayout.addView(bar);
i++;
}
BarData data = new BarData("Sep", 3.4f, "3.4€", 10f);
dataList.add(data);
data = new BarData("Oct", 8.0f, "8.0€", 20f);
dataList.add(data);
data = new BarData("Nov", 1.8f, "1.8€", 40f);
dataList.add(data);
data = new BarData("Dec", 7.3f, "7.3€", 100f);
dataList.add(data);
data = new BarData("Jan", 6.2f, "6.2€", 25f);
dataList.add(data);
data = new BarData("Feb", 3.3f, "3.3€", 20f);
dataList.add(data);
But still there is not change in the max value in the bars.
Is anything else I need to change.
from chartprogressbar-android.
As I said you need to change the build()
function inside the ChartProgressBar
class.
from chartprogressbar-android.
@hadiidbouk I create a PR, let's talk there I did the exact same thing.
Checkout: #4
from chartprogressbar-android.
Related Issues (20)
- Create horizontal bar chart HOT 2
- gap is shown but without any element
- Animation
- How to manage horizontal scrolling? HOT 3
- Horizontal Viewing
- Resources$NotFoundException: Resource ID #0x0 HOT 5
- Hide Tooltips(pins) HOT 1
- set Max Progress to each bar
- How show negative value?
- How Can I change font family
- how to set RTL direction in hdprogressbar??
- How to give padding between bars and can make it scrollable? HOT 2
- How to create progress chart
- When the amount of data set is large, the height will be uneven
- Make Seekbar follow chart maxValue HOT 3
- selectBar(int index) This method does not work well. HOT 8
- Resources$NotFoundException: Resource ID #0x0 on androidx HOT 3
- Cannot resolve symbol '@drawable/ic_pin HOT 2
- gradle sync failed with version 2.0.4 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chartprogressbar-android.