Welcome Guest Search | Active Topics |

Datapoint Label - for Datetimeaxis - Urgent Help plzzzz
Krupa
#1 Posted : Monday, November 26, 2012 6:18:14 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/30/2012(UTC)
Posts: 26

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
I am not able to view the labels for plots in the graph - Only when X-axis co-ordinates are Date values


it works fine if I give x axis value as String - data: [['A',parseInt(1)],['B',parseInt(2)]],
it doesnt work fine for data: [[new Date(2011,12,11),parseInt(1)],[new Date(2011,12,12),parseInt(2)]],

Below is the code am using

$('#vital-signs-graph').jqChart({

axes: [x1,yresp],

series: [aresp]
});




function getXaxis(){
var x1={type: 'line',
location: 'bottom',
type: 'dateTime',
intervalType: 'hours',
labels : {
stringFormat : 'mm/dd HH',
angle: -90
},
interval : 1,
name: 'xhour',
title: { text: 'Hour', font: '10px sans-serif' }
};
return x1;
}

function getYresp(){
var yresp=
{
name: 'yresp',
location: 'left',
strokeStyle: '#0066FF',
title: { text: 'Resp.Rate', font: '10px sans-serif' }
};
return yresp;
}


function getRespPlot(baseresp){
var aresp=
{
id: 'iresp',
type: 'line',
title: 'Respiratory Rate',
axisY: 'yresp',
axisX: 'xhour',

data: [[new Date(2011,12,12),parseInt(1)],[new Date(2011,12,12),parseInt(2)]],
labels:
{
font: '11px sans-serif',
fillStyle: 'red'
}
};

return aresp;
Ivan
#2 Posted : Monday, November 26, 2012 7:12:44 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)
Hi,

If you remove your x-axis definition, the axis labels will be displayed correctly.
Best,
Ivan Petrov
jqChart Inc.
Krupa
#3 Posted : Monday, November 26, 2012 7:44:39 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/30/2012(UTC)
Posts: 26

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
It is not working even when I removed the X- axis definition.

Have modified my code as below:

Before:

$('#vital-signs-graph').jqChart({

axes: [x1,yresp],

series: [aresp]
});

After:


$('#vital-signs-graph').jqChart({

axes: [yresp],

series: [aresp]
});

Ivan
#4 Posted : Monday, November 26, 2012 7:48:16 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)
Can you try this code:

Code:
    $(document).ready(function () {

        $('#vital-signs-graph').jqChart({

            axes: [getYresp()],

            series: [getRespPlot()]
        });




        function getXaxis() {
            var x1 = { type: 'line',
                location: 'bottom',
                type: 'dateTime',
                intervalType: 'hours',
                labels: {
                    stringFormat: 'mm/dd HH',
                    angle: -90
                },
                interval: 1,
                name: 'xhour',
                title: { text: 'Hour', font: '10px sans-serif' }
            };
            return x1;
        }

        function getYresp() {
            var yresp =
{
     name: 'yresp',
     location: 'left',
     strokeStyle: '#0066FF',
     title: { text: 'Resp.Rate', font: '10px sans-serif' }
};
            return yresp;
        }


        function getRespPlot(baseresp) {
            var aresp =
{
     id: 'iresp',
     type: 'line',
     title: 'Respiratory Rate',
     axisY: 'yresp',
     axisX: 'xhour',

     data: [[new Date(2011, 11, 12), parseInt(1)], [new Date(2011, 12, 12), parseInt(2)]],
     labels:
{
    font: '11px sans-serif',
    fillStyle: 'red'
}
};

            return aresp;
        }

    });

Best,
Ivan Petrov
jqChart Inc.
Krupa
#5 Posted : Monday, November 26, 2012 8:48:59 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/30/2012(UTC)
Posts: 26

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Sorry We tried removing the X- axis definition and tried the code you provided. We are still not getting the data point labels.

Please help.
Ivan
#6 Posted : Monday, November 26, 2012 8:53:56 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)
Did you try the exact code from my previous post?
Best,
Ivan Petrov
jqChart Inc.
Krupa
#7 Posted : Monday, November 26, 2012 9:00:48 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/30/2012(UTC)
Posts: 26

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Yes, I tried almost exactly the same

see the exact code below,

function getRespPlot(baseresp){
var aresp=
{
id: 'iresp',
type: 'line',
title: 'Respiratory Rate',
axisY: 'yresp',
axisX: 'xhour',
//data: baseresp,
data: [[new Date(2011, 11, 12), parseInt(1)], [new Date(2011, 12, 12), parseInt(2)]],
labels:
{
font: '11px sans-serif',
fillStyle: 'red'
}

};

return aresp;

}


function getYresp(){
var yresp=
{
name: 'yresp',
location: 'left',
strokeStyle: '#0066FF',
title: { text: 'Resp.Rate', font: '10px sans-serif' }
};
return yresp;
}


$('#vital-signs-graph').jqChart({

axes: [getYresp()],

series: [getRespPlot(baseresp)]


});
Ivan
#8 Posted : Monday, November 26, 2012 9:08:14 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)
It gives me that 'baseresp' is undefined. I removed it and your code is working ok.

I'm not sure are you creating the chart within $(document).ready block:

$(document).ready(function () {
$('#selector').jqChart({...})
});
Best,
Ivan Petrov
jqChart Inc.
Krupa
#9 Posted : Monday, November 26, 2012 9:21:32 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/30/2012(UTC)
Posts: 26

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
We are using Extjs not jquery. We tried the same code after removing baseRep parameter. Even then we are facing the same issue.

If we format the date value to String and try, then the data point labels are getting displayed but the graph is getting plotted wrongly.

Please help.

Ivan
#10 Posted : Tuesday, November 27, 2012 10:16:05 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)
We really want to find this issue and helping you. You are combining a few libraries and with sending us only our code it is impossible to find the real issue.

Please, can you prepare a sample project where the issue is reproducible and send us via email?
Best,
Ivan Petrov
jqChart Inc.
Users browsing this topic
Guest (2)
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.151 seconds.