Line Chart with custom X axis

I have data that needs to be plotted on the X axis as a date. The data is spread over 2 hours but does not have any uniform distribution over that time. For example the second data item could be 5 minutes from the first whereas the third one could be 30 seconds from the second.

I need the X axis to have the two hour window with lines at each 10 minutes. I tried the custom X axis for this and the axis shows up fine but then it only plots the items that fall exactly on the 10 minute window.

How do I get the other items to show up. See the snippet:

https://snippet.webix.com/dnk65jfm

I would like the chart to show up exactly as this but with all the data showing.

I tried using the next function on units to be calculated from the next data item. But if I do that the X axis is not uniformally spread over the two hours and I cant have that.

Comments

  • Hi,

    For your scenario "scatter" chart will work better than "line" chart
    Check
    https://snippet.webix.com/zkryn28v

    In two weeks we are releasing Webix 5.4, which will include the ability to render lines in "scatter" chart mode, which will allow to link items with a line in the above chart, so it will look exactly as the line chart but with custom scales and placement.

  • @maksim thanks. I will look forward to that. I am evaluating webix for a solution and have been stuck with this issue. My requirement is to have uniform scaled values on the Xaxis and the webix line chart does not cut it as my data does not show periodic and predictable patterns.

  • @maksim I have a more complete example that uses the scatter plot as you suggested.

    https://snippet.webix.com/55b4d00e

    It all seems to work and I am hoping will continue to work with the 5.4 version with lines to satisfy my requirement.

    Selecting a range in second chart does update the data points in the first chart, as expected. But the xAxis remains the same on the first chart so does not give the zoom effect on the data.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion