-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to change Waterfall Chart bar fill color. #37
Comments
@gmcodebuster AnyChartView anyChartView = findViewById(R.id.any_chart_view);
Waterfall waterfall = AnyChart.waterfall();
List<DataEntry> data = new ArrayList<>();
data.add(new ValueDataEntry("Start", 23));
data.add(new ValueDataEntry("Jan", 22));
data.add(new ValueDataEntry("Feb", -46));
data.add(new ValueDataEntry("Mar", -91));
data.add(new ValueDataEntry("Apr", 37));
data.add(new ValueDataEntry("May", -21));
data.add(new ValueDataEntry("Jun", 53));
data.add(new ValueDataEntry("Jul", 31));
data.add(new ValueDataEntry("Aug", -15));
data.add(new ValueDataEntry("Sep", 42));
data.add(new ValueDataEntry("Oct", 53));
data.add(new ValueDataEntry("Nov", -15));
data.add(new ValueDataEntry("Dec", 51));
DataEntry end = new DataEntry();
end.setValue("x", "End");
end.setValue("isTotal", true);
data.add(end);
Set set = Set.instantiate();
set.data(data);
com.anychart.core.waterfall.series.Waterfall series = waterfall.waterfall(set, "");
series.normal().fill("#ff6666 0.3");
series.normal().hatchFill("forward-diagonal", "#ff6666", 0.5, 10);
series.normal().stroke("#ff6666");
series.hovered().fill("#ff6666 0.1");
series.hovered().hatchFill("forward-diagonal", "#ff6666", 0.5, 10);
series.hovered().stroke("#ff6666 2");
series.selected().fill("#ff6666", 0.5);
series.selected().hatchFill("forward-diagonal", "#ff6666", 0.5, 10);
series.selected().stroke("#ff6666 4");
series.normal().fallingFill("#00cc99", 0.3);
series.normal().fallingStroke("#00cc99", 1, "10 5", "round", "null");
series.hovered().fallingFill("#00cc99", 0.1);
series.hovered().fallingStroke("#00cc99", 2, "10 5", "round", "null");
series.selected().fallingFill("#00cc99", 0.5);
series.selected().fallingStroke("#00cc99", 4, "10 5", "round", "null");
series.normal().risingFill("#0066cc", 0.3);
series.normal().risingStroke("#0066cc");
series.hovered().risingFill("#0066cc", 0.1);
series.hovered().risingStroke("#0066cc 2");
series.selected().risingFill("#0066cc", 0.5);
series.selected().risingStroke("#0066cc 4");
waterfall.title("Waterfall Chart: Appearance");
anyChartView.setChart(waterfall); |
Thank you for your prompt reply, Code works like charm. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to set custom color into waterfall chart start, end, raise and fall bar. I could not find a way to set color to bar and in legend.
Need your help to set custom color in chart.
Thanking you.
The text was updated successfully, but these errors were encountered: