Line Graph X-Axis Step

Is there any way to control how many vertical lines appear when xAxis: {lines: true}? My data set has many data points, but I only want to show five lines at regular intervals. Similarly, I only want to show the xAxis: {template: #xData#} for those five lines, instead of at every data point. Is there a way to customize Line (and Spline) graphs to do this? Thanks!

Hello,

lines property is not a Template. However, “template” of xAxis property is a Template and axis label is rendered before lines. Therefore, you may define the necessary lines property in the “template”. Here is the example where lines and axis labels are rendered only for items with odd index:

var yourChart = new dhtmlXChart({ .... xAxis:{ lines:true, template:function(obj){ if(yourChart.indexById(obj.id)%2){ yourChart.config.xAxis.lines = true; return obj.xData; } yourChart.config.xAxis.lines = false; return "" } } });