Welcome Guest Search | Active Topics |

Forcing Radar Chart to display a maximum scale
yvee
#1 Posted : Thursday, January 31, 2013 9:46:36 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/31/2013(UTC)
Posts: 4

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Hi

Is it possible to force a range of values to be displayed on a radar chart?

I tried setting minimum to 0 and maximum to 2, without any luck.

Thanks in advance




$('#rChart').jqChart({
title: { text: 'Team Chart' },
border: { strokeStyle: '#6ba851' },
background: background,
axes: [
{
type: 'categoryAngle',
majorGridLines: {
lineWidth: 20,
strokeStyle: 'red',
interval: 1
},
minorGridLines: {
lineWidth: 20,
strokeStyle: 'green',
interval: 0.5
},
minimum: 0,
maximum: 2,
interval: 0.1,
categories: fullnames
}
],
series: [
{
title: 'Self',
type: 'radarLine',
data: orbitsSelf
}
]
});
Ivan
#2 Posted : Friday, February 1, 2013 3:31:48 AM(UTC)
Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 11/5/2012(UTC)
Posts: 131

Thanks: 0 times
Was thanked: 15 time(s) in 15 post(s)
You can force the range with set minimum/maximum of the linearAxis scale:
Code:
axes :
[{
    type: 'linearRadius',
    minimum: 0,
    maximum: 100,
    interval: 20
}]

More info:

http://www.jqchart.com/jquery/chart/ChartAxes/LinearRadiusAxis

http://www.jqchart.com/documentation/userguide/default.aspx#!LinearRadiusAxis
Best,
Ivan Petrov
jqChart Inc.
yvee
#3 Posted : Wednesday, February 20, 2013 10:16:33 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/31/2013(UTC)
Posts: 4

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Hi Ivan

Thanks for the reply.

My code actually already contains the min, max and interval options on the axes.

minimum: 0,
maximum: 2,
interval: 0.1,

As you can see below the maximum interval is not being displayed. This works perfectly on all of the line charts I have tried except on Radar Line charts.




Regards
Ivan
#4 Posted : Thursday, February 21, 2013 2:14:48 PM(UTC)
Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 11/5/2012(UTC)
Posts: 131

Thanks: 0 times
Was thanked: 15 time(s) in 15 post(s)
Is it possible to give us the whole code, so I can look at it?
Best,
Ivan Petrov
jqChart Inc.
yvee
#5 Posted : Sunday, February 24, 2013 8:33:52 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/31/2013(UTC)
Posts: 4

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Hi Ivan

Here is the source code.

Thanks in advamce

Code:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Project.Models.Employee>" %>
<%@ Import Namespace="Project.Models" %>
<div id="rChart" style="width: 430px; height: 300px;">
</div>
<script lang="javascript" type="text/javascript">
           
            function initChart(fullnames, orbitsSelf) {

              var background = {
                            type: 'linearGradient',
                            x0: 0,
                            y0: 0,
                            x1: 0,
                            y1: 1,
                            colorStops: [{ offset: 0, color: '#d2e6c9' },
                                         { offset: 1, color: 'white'}]
               };

            $('#rChart').jqChart({
                title: { text: 'Team Latest Orbits' },
                border: { strokeStyle: '#6ba851' },
                background: background,
                axes: [
                        {
                            type: 'categoryAngle',
                            majorGridLines: {
                                lineWidth: 20,
                                strokeStyle: 'red',
                                interval: 1
                            },
                            minorGridLines: {
                                lineWidth: 20,
                                strokeStyle: 'green',
                                interval: 0.5
                            },
                            minimum: 0,
                            maximum: 2.1,
                            interval: 0.1,
                            categories: fullnames
                        }
                      ],
                series: [
                            {
                                title: 'Self',
                                type: 'radarLine',
                                data: orbitsSelf
                            }
                        ]
                        });
            }


        function getSelfOrbits()
        {
            $.ajax(
            {
                type: "POST",
                url:  '<%= Url.Action("LatestTeamOrbitsForManager") %>',
                data:   { id: <%= Model.Id  %>, type: 'self' },
                dataType: 'json',
                success: function (msg) {   
                    var data = msg;
                    var employeeIds = [];
                    var orbitsSelfValues = [];                 
                    var orbitsManager = [];
                    for (var i = 0; i< data.length ; i++)
                    {
                        employeeIds[i] = (data[i].id);
                        orbitsSelfValues[i] = (data[i].value);                     
                    }
                   
                    initChart(employeeIds, orbitsSelfValues);
                    getManagerOrbits();
                }
            });
        }

        function getManagerOrbits()
        {
            $.ajax(
            {
                type: "POST",
                url:  '<%= Url.Action("LatestTeamOrbitsForManager") %>',
                data:   { id: <%= Model.Id  %>, type: 'manager' },
                dataType: 'json',
                success: function (data) {   
                    var orbitsManager = [];
                    for (var i = 0; i< data.length ; i++)
                    {
                        orbitsManager[i] = (data[i].value);                     
                    }
                   
                    updateChart('manager', orbitsManager);
                    getCulturalOrbits();
                }
            });
        }


        function getCulturalOrbits()
        {
            $.ajax(
            {
                type: "POST",
                url:  '<%= Url.Action("LatestTeamOrbitsForManager") %>',
                data:   { id: <%= Model.Id  %>, type: 'cultural' },
                dataType: 'json',
                success: function (data) {
                    var orbitsCultural = [];
                    for (var i = 0; i< data.length ; i++)
                    {
                        orbitsCultural[i] = (data[i].value);                     
                    }
                   
                    updateChart('cultural', orbitsCultural);
                }
            });
        }


        function updateChart(type, data)
        {
            // Get data from self orbits
            var series = $('#rChart').jqChart('option', 'series');
           
            var author;
            if (type == 'manager')
            {   
                author = 'Manager';
            }
            else
            {
                author = 'Cultural Leader';
            }


            var newSeries = {
                title: author,
                type: 'radarLine',
                data: data
            };
           
            series.push(newSeries);
            $('#rChart').jqChart('update');

        }

        $(document).ready(
            function () {
                getSelfOrbits();
             }
        );


</script>

Ivan
#6 Posted : Monday, February 25, 2013 4:01:37 AM(UTC)
Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 11/5/2012(UTC)
Posts: 131

Thanks: 0 times
Was thanked: 15 time(s) in 15 post(s)
Try changing your axes code to:

Code:
axes: [
                        {
                            type: 'categoryAngle',
                            categories: fullnames
                        },
                        {
                            type: 'linearRadius',
                            minimum: 0,
                            maximum: 2.1,
                            interval: 0.1
                        }
         ],



http://www.jqchart.com/jquery/chart/ChartAxes/LinearRadiusAxis
Best,
Ivan Petrov
jqChart Inc.
yvee
#7 Posted : Tuesday, February 26, 2013 3:06:48 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/31/2013(UTC)
Posts: 4

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Hi Ivan

Thanks very much :) It works.

Regards
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.120 seconds.