I have a PieChart with many sections, legend for this PieChart renders as one row. How to render legend as two columns?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The method
getLegendItem(), seen here, provides all the information needed to render a legend item in anyContaineryou choose.GridLayout(0, 2)will arrange them in two columns for any number of rows. To suppress the existing legend, setlegendtofalsewhen you call your chart factory; the items will still be available, as suggested here.Addendum: Based on
PieChartDemo1, this fragment uses thegetLegendItems().iteratorand a variation of thisColorIcon.