Home forums Using CanvasJS X Axis Data Consists of year and y consists of runs made by player

This topic contains 19 replies, has 3 voices, and was last updated by  Sunil Urs 3 months, 2 weeks ago.

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #10485

    Cameron
    Member

    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…..

    #10492

    Sanjoy
    Moderator

    [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.

    #10504

    Cameron
    Member

    Yes valueFormatString is working correctly but if width is “100%” then it does not work in the case of Year representation in xAxis.

    #10506

    Cameron
    Member

    In your example also if you plot x-axis data with respect to year then you see data comes as quama seperated.

    #10507

    Cameron
    Member

    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.

    #10508

    Cameron
    Member

    Here is a example link.

    #10509

    Cameron
    Member

    And also is it possible to start X and Y axis from initial point with out gap from left for X-axis.

    #10511

    Sanjoy
    Moderator

    [Update]: We have just released v1.9.0 with Logarithmic Axis. Please checkout gallery page for Logarithmic Scale.

    Cameron,

    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";

    • This reply was modified 6 months, 3 weeks ago by  Sanjoy.
    #10515

    Cameron
    Member

    Can you please create another feedle for my requirement.

    #10516

    Cameron
    Member

    I implemented my function to your example and create new feedle link but you can check it is not implemented.

    #10517

    Sanjoy
    Moderator

    [Update]: We have just released v1.9.0 with Logarithmic Axis. Please checkout gallery page for Logarithmic Scale.

    Cameron,

    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.

    • This reply was modified 3 months, 2 weeks ago by  Sunil Urs.
    #10518

    Cameron
    Member

    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.

    • This reply was modified 6 months, 3 weeks ago by  Cameron.
    • This reply was modified 6 months, 3 weeks ago by  Cameron.
    • This reply was modified 6 months, 3 weeks ago by  Cameron.
    #10522

    Cameron
    Member

    Zero is not coming in Y-axis. It should be started from 0.

    #10526

    Sanjoy
    Moderator

    [Update]: We have just released v1.9.0 with Logarithmic Axis. Please checkout gallery page for Logarithmic Scale.

    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.

    • This reply was modified 3 months, 2 weeks ago by  Sunil Urs.
    #10527

    Cameron
    Member

    But please check line is not draw to X-axis for Team E. It display gap. It should draw line.

Viewing 15 posts - 1 through 15 (of 20 total)

You must be logged in to reply to this topic.