Search code examples
javascriptjqueryradar-chartanychart

Not able to make the polar charts fill the entire quadrant in Anychart


I am creating a polar chart using AnyChart

enter image description here

anychart.onDocumentReady(function () {
    // create polar chart
    var chart = anychart.polar();

    var columnSeries = chart.column([
        {x: 'A', value: 28.7},
        {x: 'B', value: 19},
        {x: 'C', value: 17.7},       
        {x: 'D', value: 34.7}
    ]);

    // set series name
    columnSeries.name('Percentage');

    // set title settings
    chart.title()
            .enabled(true)
            .text('Test')
            .padding({bottom: 20});

    // disable y-axis
    chart.yAxis(false);

    // set value prefix for tooltip
    chart.tooltip().valuePrefix('%');

    // set x-scale
    chart.xScale('ordinal');

    // set chart container id
    chart.container('container');

    // initiate chart drawing
    chart.draw();
});

https://playground.anychart.com/gallery/Polar_Charts/Column_Polar_Chart

I would like to get graphs fill up the entire quadrant similar to:

enter image description here

How is it possible?


Solution

  • You need to sort the points according to your column

    // enable sorting points by x
    chart.sortPointsByX(true);
    

    Check the live example