numetriclabz / numAndroidCharts

A Powerful Android Charting Library by https://www.numetriclabz.com/
GNU General Public License v3.0
85 stars 37 forks source link

How to set Label Width and Custom Color to FunelChart Sections #10

Open yatindeokar opened 7 years ago

yatindeokar commented 7 years ago

I want to set label width to each section of funnel chart and show fix custom color to each section. Now in getting different colors for each section every time when i run the app. i am using lib version compile 'com.numetriclabz.numandroidcharts:numandroidcharts:1.0.20' code: funnelChart = (FunnelChart) findViewById(R.id.pyramid); List values = new ArrayList<>();

    values.add(new ChartData("visits", 400));
    values.add(new ChartData("unique visits", 2000));
    values.add(new ChartData("unique visitors", 1000));
    values.add(new ChartData("unique session", 500));
    values.add(new ChartData("log out", 3000));
    values.add(new ChartData("log out1", 3000));
    values.add(new ChartData("log out2", 100));
    values.add(new ChartData("log out3", 1500));
    values.add(new ChartData("log", 2500));
    values.add(new ChartData("log o", 2000));

    funnelChart.setData(values);

Thank you!

varadmondkar commented 7 years ago

Hi @yatindeokar have you got the solution? I also want to give custom colors to each funnel section

MohammedBadr20s commented 7 years ago

Hi @yatindeokar have you got the solution? I also want to give custom colors to each funnel section?!!

paraswatts commented 6 years ago

You can download the funnel chart java file from the src code folder and use in your project from there, instead of importing from the library and give the color you want. They are by default using a random function to generate a random number and then generate a color based on that.