How can I show fixed xAxis scales

Is there any way I can set label on the horizontal scale with static values (not associated with data)?

e.g I had data for one year but for x scale label I want to show only 12 labels for each month, is there anyway to do that?

It’s posible to define template as follows:

return “any value”;

But here obj is data object. For example obj.month returns month property of an object.

x-axis for vertical bar charts can be based only on properties of loaded objects, you can’t define some point on the scale for which data is not exists.

I have about 500 numbers of data to plot the chart. I did it.
I fixed the Y-scale as fixed (static)
title: ‘Age (Years)’,
How can I do the same for X axis??. (Now it shows about 500 data getting overlapped in X-scale)

Please guide me.

You may set template for x-axis labels: some element you may return age property and empty string for others:

xAxis:{ title: 'Age (Years)', lines:true, template:function(obj){ if(obj.age%50==0) return obj.age; else return ""; } },

Thanks for the suggestion

Hi i do an array for controle the function
descripcion array position
0 = Active or inactive functionality
1= Max Separator
2= Counter

First do this global array

 var vXpar = new Array();
  vXpar[0]=1; vXpar[1]=4; vXpar[2]=0;

And them put in ur json structure

            title: 'Year',
            template: function(obj){
                  if(vXpar[2] == 0)
                     return obj.peri;
                     if(vXpar[2] == vXpar[1])vXpar[2]=0;  
                     return ' ';
              else return obj.peri;


prove changin the second position of array
vXpar[0]=1; vXpar[1]=3; vXpar[2]=0;
vXpar[0]=1; vXpar[1]=5; vXpar[2]=0;

Hi, please tell me How can i show X axis scales with step every 10 minutes if i load data from json in hh24:mi format …


if for example the labels for xAxis are passed in “time” property of chart items, you may try to use the following:

xAxis:{ template:function(obj){ var t = obj.time; var minutes = parseInt(t.split(":")[1],10); if(minutes%10==0) return obj.time; else return ""; } },

Hi, tell me please can i show vertical lines on graf only for value
var minutes = parseInt(t.split(":")[1],10); but not for value “” ???


Chart values should be numeric. Therefore, strings in hh24:mi format are not accepted. You need to convert them into numeric values. For example like so:

value:function(obj){ var arr = obj.time.split(":") return arr[0]*60+arr[1]*1 },

yAxis “template” can also be a function where you can return the desired values:

yAxis:{ template:function(value){ ... return ...; } }