Giter Club home page Giter Club logo

Comments (6)

hadiidbouk avatar hadiidbouk commented on May 28, 2024

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.

therajanmaurya avatar therajanmaurya commented on May 28, 2024

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.

hadiidbouk avatar hadiidbouk commented on May 28, 2024

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.

therajanmaurya avatar therajanmaurya commented on May 28, 2024

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.

image

from chartprogressbar-android.

hadiidbouk avatar hadiidbouk commented on May 28, 2024

As I said you need to change the build() function inside the ChartProgressBar class.

from chartprogressbar-android.

therajanmaurya avatar therajanmaurya commented on May 28, 2024

@hadiidbouk I create a PR, let's talk there I did the exact same thing.
Checkout: #4

from chartprogressbar-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.