You must be logged in to post your query.
Home › Forums › Chart Support › X Axis Data Consists of year and y consists of runs made by player
Is it possible or not? that line draw on X-axis for value 0.
Cameron,
Basically the value of log(0) is not defined and tends to -Infinity. So, if you put it in your logarithmic chart it will look like . Here to ignore such case I have mapped it’s value to null. But sill if you want to customise further you can edit convertToLog function as per your requirement. You can edit it like below
function convertToLog(data){ var dataPoints; for(var j= 0; j<data.length;j++){ dataPoints = data[j].dataPoints; for(var i = 0; i< dataPoints.length; i++){ if(dataPoints[i].y > 0) dataPoints[i].y = Math.log10(dataPoints[i].y); else if(dataPoints[i].y === 0) dataPoints[i].y = null; //update dataPoints[i].y as per your requirement (-Infinity) else dataPoints[i].y = null; } } }
Please check labels for X-Axis if width of window is maximum then it display two times year.
Setting valueFormatString to “####” will round-off all the intermediate values. So, here 2006.5 will appear as 2007 and so on. To avoid this issue you can set interval to 1.
[Update]: We have just released v1.9.0 with Logarithmic Axis. Please checkout gallery page for Logarithmic Scale.
You must be logged in to reply to this topic. Login/Register