Graphical plotting - No data for the corresponding date.

As you can see here, on the x-axis, dates are given at the same distance from a date that varies in a range.

Chart screenshot [Right click-> Open in a new tab if you do not see the image

But the distance along the X axis is equivalent for both.

  • I want the X axis to display the value 0 when there is no value for a specific date. .

    Possible solutions:

    • Is there any built-in parameter missing from AM charts for this?
    • Another solution I had in mind was an input value of 0 for a date that does not have the relevant data. [But it will lag behind the front end]
  • Date format format:

    For the date , 2014-11-12 10:15, "dataDateFormat": "YYYY-MM-DD JJ: NN" doesn't seem to work. Tried to do it in milliseconds , didn't work. Here is my violin

    "dataProvider": [{ "date": "1343364300000", "value": 1 },{ "date": "1343364900000", "value": 5 },{ "date": "1343365500000", "value": 10 },{ "date": "1343366100000", "value": 15 },{ "date": "1343366100000", "value": 8 },{ "date": "1343369520000", "value": 24 },] 

This is the circuit used for this.

http://www.amcharts.com/demos/date-based-data/#

+5
source share
1 answer

For the first point of view, if you need to display 0 on empty data, the only way is to implement the zero-fill function on the server side or JS.

I worked with the same problem a few months ago and had to implement on my server side, because the library does not have a built-in function.

Second point. Your date format is working fine, the problem is that you activated pan and zoom . Then you cannot scale and see the formatted dates, because categoryAxis.parseDates groups them in months. I suggest you turn off chartCursor.pan and set the minimum period on the axis of the mm or ss category.

Here is your modified script.

0
source

Source: https://habr.com/ru/post/1208325/


All Articles