ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Pie Chart.
Posted by Ankit Jain on Jan-02-2018 18:24
Hi Peter,

I am looking for pie chart in which I can provide different width of sectors for a pie.

I was looking at the function Sector.setStyle but this is not working as per my requirement.

What I am looking is a pie  chart which will not look as regular circle but look like a pullout for different sectors but starting point of all sectors (i.e. x and y )positions of all the sectors remain same.


Thanks
Ankit

  Re: Pie Chart.
Posted by Peter Kwan on Jan-03-2018 17:49
Hi Ankit,

Sorry, I am unable to understand your requirement. Is it possible to provide an image to help me understand what you need?

For example, I do not quite understand the "starting point of all sectors (i.e. x and y )positions of all the sectors remain same"? I am not sure what is the "starting point" of a sector. In all pie charts, all the sectors has one point in common, which is the center. In ChartDirector terminology, it considers the sectors start from different "angles", not from a "point" (x, y). If you consider the sectors to be starting from the point at the center, then in a standard pie chart, all sectors are already starting at the same point.

A sample image should help me understand what you need.

Regards
Peter Kwan

  Re: Pie Chart.
Posted by Ankit Jain on Jan-04-2018 11:33
Attachments:
Hi Peter,

I have attached the images. Original that we are able to create and required image that we need to create.

Hope this will be helpful.

Thanks
Ankit
PieChart.docx
PieChart.docx

103.08 Kb

  Re: Pie Chart.
Posted by Peter Kwan on Jan-05-2018 00:57
Hi Ankit,

I can think of two methods.

(a) You can use a method similar to drawing a rose chart.

http://www.advsofteng.com/doc/cdjava.htm#rose.htm

You just need to set everything to transparent, except the rose chart itself, and use different colors for the sectors.


(b) Use can use multiple pie chart objects, one for each sector, and combine them using a MultiChart. it is like:

    double[] data = {25, 18, 15, 12, 8, 30, 35};
    int[] radius = { 60, 70, 80, 90, 100, 40, 50 };

    MultiChart m = new MultiChart(360, 300);

    for (int i = 0; i < data.Length; ++i)
    {
        PieChart c = new PieChart(360, 300, Chart.Transparent);
        m.addChart(0, 0, c);
        c.setPieSize(180, 140, radius[i]);
        c.setData(data);
        c.setLabelStyle("normal", 8, Chart.Transparent);
        for (int j = 0; j < data.Length; ++j)
        c.sector(j).setColor((i == j) ? Chart.DataColor + j : Chart.Transparent, Chart.Transparent);
    }

    viewer.setChart(m);

Hope this can help.

Regards
Peter Kwan

  Re: Pie Chart.
Posted by Ankit Jain on Jan-09-2018 12:09
Thanks Peter.

Thanks for your useful suggestion. I am mid of implementation will come back to you in case further assistance is needed.

Thanks
Ankit