jQWidgets Forums

jQuery UI Widgets Forums Chart Hide weekends of line series

This topic contains 5 replies, has 2 voices, and was last updated by  ivailo 9 years, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Hide weekends of line series #82262

    Emanuel U.
    Participant

    Hi,

    I’ve a set of data with dates on the x-Axis. For example from 07.03.2016 to 21.03.2016. Each day has a value and so far the line is drawn how I want it. From time to time I want to hide the data points of the Weekends (12.03, 13.03, 19.03, 20.03). Although I remove them from the data source the chart still draws it. Do you have any idea how I can solve my Problem?

    Thank you

    Emanuel

    Hide weekends of line series #82266

    ivailo
    Participant

    Hi Emanuel U.,

    You can use formatFunction callback of the labels to check about these dates and return empty string if any is occurred.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Hide weekends of line series #82277

    Emanuel U.
    Participant

    Thank you for your reply but this is not what I wanted. I wrote a sample in jsfiddle

    http://jsfiddle.net/7wQzp/50/

    You can see that there is some space between the 11.3 and 14.3 where I removed the labels. What I wanted is to remove the space, so that the 14.3 comes right after 11.03 with the same space like between the 7.3 and 8.3. Even if I remove the 12.3 and 13.3 from the source the values of the xAxis remains the same.

    Hope you can understand it better now

    Kind regards
    Emanuel

    Hide weekends of line series #82316

    ivailo
    Participant

    Hi Emanuel U.,

    In this case you can use type: 'basic', instead type: 'date', in your xAxis settings.
    This will display only the given data from your source.
    Here is a demo.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Hide weekends of line series #82324

    Emanuel U.
    Participant

    Wow, that’s is really great. Thank you very much. That helps me a lot.

    Now we can go to the next level^^ Or better let me call it a little detail. You know “the devil is always in the details”.

    Here is another demo: http://jsfiddle.net/kndf10gy/1/

    There you can see 2 series. Serie 2 starts where serie 1 ends and you can see that I added a time value on the intersection. If you have

    type:date for the x-Axis the intersection chances with the time value. If I take 5 for the hour value the point is closer to the 11, if I take 22 it is closer to the 12. If I take type:basic the intersection is always on the same place. Of course it is, because the type:basic draws the number of points and refers not to the date values.

    I know it is very difficult, but I believe you’ll find a solution.

    Thanks a lot for the help

    Kind regards
    Emanuel

    Hide weekends of line series #82347

    ivailo
    Participant

    Hi Emanuel U.,

    You can remove the unused dates from your source and use type: 'basic',.
    Here is a demo.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.