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

Message ListMessage List     Post MessagePost Message

  Pie/radar/polar
Posted by Brian on Mar-04-2021 22:14
Attachments:
Hello Peter

is there any way of producing a chart similar to the chart.js polar area chart
where the segments have the same angle but vary in diameter depending on the values

I have looked at you Pie, Radar and Polar examples some come close

I attach an image that explains it better

Thanks in advance

Brian
Image2.jpg

  Re: Pie/radar/polar
Posted by Peter Kwan on Mar-04-2021 23:11
Hi Brian,

Yes. It is called the Rose chart in our sample code.

https://www.advsofteng.com/doc/cdnet.htm#rose.htm

In the above example, all the sectors are green with an angular span of 15 degrees. If you look at the code, the angles and colors of the sectors are individually configurable, so you can certainly use different angles and colors for the  sectors.

For the legend box, you can use LegendBox.addKey to add the legend key.

The code should similar to:

// Set the position of the legend box
LegendBox b = c.addLegend(......);
// Use this line if you want a bigger legend icon
b.setKeySize(30, 12);

for(int i = 0; i < data.Length; ++i) {
    c.angularAxis().addZone(startAngles[i], endAngles[i], 0, data[i], sectorColor[i], sectorColor[i]);
    b.addKey(name[i], sectorColor[i]);
}

For anything that you want to hide (such as the axis labels), just set their colors to Chart.Transparent.

Regards
Peter Kwan

  Re: Pie/radar/polar
Posted by Brian on Mar-04-2021 23:16
Thank you very much Peter and for the amazingly fast response

You are a star