Home Forums Chart Support Can I draw a solid line at the top of the graph ?

Can I draw a solid line at the top of the graph ?

Viewing 8 posts - 1 through 8 (of 8 total)
  • #32761

    Hi.

    As shown in the example below, if the grid line type is set to something other than solid, the line at the top of the graph will not be solid.
    https://jsfiddle.net/katsukino/3wgd60j1/1/

    I would like to draw solid line at top of the graph.
    I need a suggestion for a solution.

    #32763

    @kinokatsu,

    The lines drawn at every interval of the axis are gridlines, including the line which you are referring. Gridlines are drawn as dashed lines as you are setting gridDashType to “dash”. It’s not possible to just change dash-type of just one gridline as of now. However you can add a stripline at the maximum of the axis to achieve your requirement. Please take a look at this updated JSFiddle for an example on the same.


    Vishwas R
    Team CanvasJS

    #32765

    Hi Vishwas.
    thanks for your reply.

    Is the only way to draw with “stripline”….
    If you draw with “stripline”, the line will be displayed when you zoom in.
    (range axisX:40-70)
    https://jsfiddle.net/katsukino/6r8hmsq1/2/

    In “axisX”, the line type can be set by “lineDashType” (bottom line).
    Can’t I do the same thing with axisX2?

    #32766

    @kinokatsu,

    You can update the stripline value dynamically using set method when you zoom or pan upon rangeChanged event as shown in this updated JSFiddle.


    Vishwas R
    Team CanvasJS

    #32787

    Hi Vishwas.
    thanks for your reply.

    I see.
    The way to reconfigure it is to use the “rangeChanged” event.

    I found another way.

    By adding a dummy “dataseries” and setting “axisYType” to “secondary”, I was able to display a line at the top of the graph.

    jsfiddle

    #32788

    I mistaked.

    axisYType –> axisXType.

    #32794

    @kinokatsu,

    Adding dummy series to secondary x-axis also works in your case. Glad that you were able to fulfill your requirements :)


    Vishwas R
    Team CanvasJS

    #32799

    Hi Vishwas.

    I found a good way to do this because it has a lot of features.

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

You must be logged in to reply to this topic.