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
I am working with a line chart. My line chart create perfectly but these two things are not implementing:
1. X-Axis: This data is consists of year but it is taking half value also like 2010 is year then it display as thosand seperator “2,010” and also having next value is coming with .5 like “2,010.5”. I dont want thousand seperator. I want simply year display and also half value not show. I see “valueFormatString” for X-axis but it is not working for me.
2. In Y-axis i want data range is big 10,100,1000,10000 and so on…..
[Update]: We have just released v1.9.0 with Logarithmic Axis. Please checkout gallery page for Logarithmic Scale.
Cameron,
1. We checked, valueFormatString is working fine. Can you pleasse create a jsfiddle with reproducing the issue.
2. Are you looking for logarithmic axisY? Here is an example. If this doesn’t suite your requirements, could you please provide us a pictorial representation to understand better.
Yes valueFormatString is working correctly but if width is “100%” then it does not work in the case of Year representation in xAxis.
In your example also if you plot x-axis data with respect to year then you see data comes as quama seperated.
Please check updated fiddle example in this if i apply changes for Y-axis it is not implementing. Example. I again revert my changes. Please apply changes for Y-axis.
Here is a example link.
And also is it possible to start X and Y axis from initial point with out gap from left for X-axis.
In your example you have to set valueFormatString inside axisY object for applying to axisY labels.
In case you are using labelFormatter for implementing logarithmic axisY it will override valueFormatString. So, in this case inside labelFormatter function in the CanvasJS.formatNumber method you have to pass required format as second argument. Eg. in the example of logarithmic axisY by rewriting line 12 as below would remove the comma.
lable = CanvasJS.formatNumber(lable/1000, "####") +"k";
Can you please create another feedle for my requirement.
I implemented my function to your example and create new feedle link but you can check it is not implemented.
I have made necessary change as per your requirement. And here is the updated fiddle. Hope, this will help you.
And in log scale you can plot only positive numbers. So, for negative numbers and zero you can transform it to null value.
Got my issue. Thanks it is working and one more thing can X and Y axis start from same point so gap not occurs from left.
Zero is not coming in Y-axis. It should be started from 0.
You can manage the viewport by setting viewportMinimum and/or viewportMaximum. Using which you can reduce the gap. And in logarithmic axis 0 always maps to 1 as log(1) = 0.
But please check line is not draw to X-axis for Team E. It display gap. It should draw line.
You must be logged in to reply to this topic. Login/Register