Home forums Using CanvasJS How to show labels just where have data points

This topic contains 1 reply, has 2 voices, and was last updated by  Anjali 2 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7147

    andrebolina
    Participant

    I want show labels just where have data points, because in responsive (resolution < 768px) gets a mess. How?
    problem

    In image above, just the three marked labels should appear

    More informations:
    1o.) I’m using timestamp labels.
    2o.) In data I add xValueType: “dateTime”
    3o.) My axisX configuration:
    axisX:{
    gridColor: “Silver”,
    tickColor: “silver”,
    valueFormatString: “DD/MMM”
    }

    • This topic was modified 2 years, 2 months ago by  andrebolina.
    • This topic was modified 2 years, 2 months ago by  andrebolina.
    • This topic was modified 2 years, 2 months ago by  andrebolina.
    #7157

    Anjali
    Participant

    Hi,

    For doing the same, set the valueFormatString to empty string inside axisX and assign the formatted date to the label. Here is an example.

    For formatting dateTime values you can use Either use MomentJS or assign it directly on the server side too.

    because in responsive (resolution < 768px) gets a mess

    Just want to know what is going wrong when resolution is < 768px. Can you please create a JSFiddle so that we can have a look. As long as you have not set interval property, it should automatically adjust to any screen size. Try changing window size in this example.


    Anjali

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

You must be logged in to reply to this topic.