Skip to content

Instantly share code, notes, and snippets.

@Shestac92
Forked from ArsenyMalkov/FunnelChartActivity.Java
Last active March 1, 2018 08:56
Show Gist options
  • Save Shestac92/26a0ad7e121db653aca924de02f90fcc to your computer and use it in GitHub Desktop.
Save Shestac92/26a0ad7e121db653aca924de02f90fcc 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("{%x} ---------------------- {%value}")
.setAnchor(EnumsAnchor.LEFT_CENTER)
.setFontColor("#000");
anyChartView.setChart(funnel);
}
}
@ytam
Copy link

ytam commented Mar 1, 2018

How to setformat with percent of data ? In here; .setFormat("{%x} ---------------------- {%value}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment