Skip to content

Instantly share code, notes, and snippets.

@ArsenyMalkov
Created February 20, 2018 04:12
Show Gist options
  • Save ArsenyMalkov/55646b9e26a0dfbcedc8fb5d8901d451 to your computer and use it in GitHub Desktop.
Save ArsenyMalkov/55646b9e26a0dfbcedc8fb5d8901d451 to your computer and use it in GitHub Desktop.
public class FunnelChartActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chart_common);
AnyChartView anyChartView = findViewById(R.id.any_chart_view);
Funnel funnel = AnyChart.funnel();
List<DataEntry> data = new ArrayList<>();
data.add(new ValueDataEntry("Total Market", 232000));
data.add(new ValueDataEntry("Prospects", 94480));
data.add(new ValueDataEntry("Leads", 47390));
data.add(new ValueDataEntry("Sales", 22181));
funnel.setData(data);
funnel.setPalette(new String[]{ "#aaa", "#f55", "#5f5", "#55f" });
funnel.getLabels()
.setPosition("outsideleft")
.setFormat("{%value} ---------------------- {%x}")
.setAnchor(EnumsAnchor.LEFT_CENTER)
.setFontColor("#000");
anyChartView.setChart(funnel);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment