Home Forums Chart Support Some personal questions

Some personal questions

Viewing 9 posts - 1 through 9 (of 9 total)
  • #15753

    Hi everyone!

    I’m totally new in using CanvasJS and I’m starting to edit some graph that I would like to use but I encountered some problems with it.

    First, I’m using a line type of graph with a date xAxis. Could it be possible to make it start at the beginning of the graph? Because the first date on the xAxis is 01/06 (which is basically January 2006) and my first point is at the 30th May of 2006 (It’s 30/04 because I had to put 04 rather than 05 to have May) – (‘x: new Date(2006, 04, 30)‘) so is it possible to make the graph start at the origine?

    Furthermore, the yAxis has no type (Date, …), here is an exemple of one line:

    dataPoints: [
            { x: new Date(2006, 04, 30), y: 100 },
            { x: new Date(2012, 05, 29), y: 148 },
            { x: new Date(2014, 05, 30), y: 220 },
            { x: new Date(2016, 05, 30), y: 230 },
            { x: new Date(2017, 07, 03), y: 255}

    The graph automatically put the xAxis between 0 and 300. Is it possible to change those values manually and to put those in percentages? Same for the dates which are all 01/06, 01/07, … until 01/17 (january 2018), can I change those dates manually?

    Then, I would also like to change the appearance of the line. I saw the random generator that made a huge and smooth line at the end of the ‘Axis Element’ chart tutorial, can I turn the verry squared line I have into this one? Or is it made by a lack of points? (I have like 6 points, I’ll have more than 2000 later on).

    To finish with, as I said above, I will soon have like 2000 points to put on the graph. I will select them from the database. Is there a way, in PHP, to fill the points array with all those points without putting them one by one, the latest being added each time too?

    Thanks for reading, I hope I didn’t make too many typos.

    Best regards,

    • This topic was modified 6 years, 1 month ago by ElToredo. Reason: I made a mistake in my typing

    I can’t seem to find the edit button anymore.

    Anyway, I’d like to add when I was speaking about the line appearence that I would like to have like the model in the ‘Axis Element’ chart tutorial, in this model, you don’t have any points except where you place your mouse. That would be amazing to have the same, is it possible?


    Here is my JSFiddle : http://jsfiddle.net/QwZuf/727/ (sorry for the multi-spam)

    • This reply was modified 6 years, 1 month ago by ElToredo.

    Any thoughts?



    You can set the minimum of both the axes to the value of the first dataPoint to start the graph from origin.

    The axisY can be formatted to percentage by using labelFormatter(). And to change the date manually formateDate() can be used.

    Spline chart can be used for achieving smooth line.

    You can refer to this thread to populate data using database and PHP.

    The markers can be showed only on hover by seting markerSize: 0 at dataSeries or dataPoint level.

    Please take a look at this following example.



    Thanks a lot for your help, I couldn’t have expected something better, let’s work!


    I have put a strip line at 0% on my graph. Is it possible to put a little line on it at each xAxis value?
    Like on this dirty paint image: http://imgur.com/oUeMJ4f



    Placing a tick on the axis is not possible as of now. However you can achieve something similar
    using this work-around.

    Indranil Deo,
    Team CanvasJS


    I see the point, it should be okay, thanks again until the next time haha!

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.