Home forums Using CanvasJS display markerType in legend

This topic contains 3 replies, has 2 voices, and was last updated by  Indranil Deo 4 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20071

    cancanvas
    Member

    Hi There,

    How do I display cross and triangle marker in legend and specify its meaning, i.e. triangle for gain and cross for loss? Thank you.
    See https://jsfiddle.net/cancanvas/Loab2h6L/5/

    #20073

    Indranil Deo
    Member

    @cancanvas,

    Only one legend can be associated with a dataSeries as of now. You can add a dummy dataSeries with a legend to show multiple legends. Please take a look at this jsfiddle.

    ___________
    Indranil Deo,
    Team CanvasJS

    #20078

    cancanvas
    Member

    Hi Indranil,

    Thanks for the reply. It makes sense. Now I have different issues. Please check https://jsfiddle.net/cancanvas/Loab2h6L/17/
    Question1: Why the legend of series 2 and 3 dose NOT show dot/dash line? I need to make it consistent with the chart.
    Question2: Is there any way I can group legend make stype them separately. e.g. I want to make series 1, 2,3 legend virtically aligned to the left bottom and label 1 and 2 vertically aligned to the right bottom.
    Question3: All my data has integer as x value, why it automatically calculated to interval as 0.5? I cannot specify interval to a specific integer because it is dynamic based on data comes in. But I need x value always calculated and displayed as integer. How can I implement this?

    Thank you very much!

    #20080

    Indranil Deo
    Member

    @cancanvas,

    Question1: Why the legend of series 2 and 3 dose NOT show dot/dash line? I need to make it consistent with the chart.

    Changing legend line dash type is not possible as of now. However, you can workaround this by setting the legendMarkerColor to white and legendMarkerType to triangle. Please take a look at this jsfiddle

    Question2: Is there any way I can group legend make stype them separately. e.g. I want to make series 1, 2,3 legend virtically aligned to the left bottom and label 1 and 2 vertically aligned to the right bottom.

    Sorry, it’s not possible to group legends as of now. All legends will be positioned together.

    Question3: All my data has integer as x value, why it automatically calculated to interval as 0.5? I cannot specify interval to a specific integer because it is dynamic based on data comes in. But I need x value always calculated and displayed as integer. How can I implement this?

    Axis interval depends on the axis range, number of ticks, as well as width of the chart, which means more the width of the chart interval will be less and lesser the width of chart interval will be more. You can try setting interval and update it based on the new dataPoint x-values added.

    ___________
    Indranil Deo,
    Team CanvasJS

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

You must be logged in to reply to this topic.