amcharts3 icon indicating copy to clipboard operation
amcharts3 copied to clipboard

[BUG] gaps in chart

Open scholtz opened this issue 6 years ago • 5 comments

Hi,

I believe there is a bug in amcharts in some data handling..

See demo here: http://apps.scholtz.sk/amcharts.html

Chart should be connected by default, but i see there obvious spaces.

options connect = true, nor equalSpacing=true|false, nor forceGap = false do not work here..

Also there is an another bug that may be related to this issue.. When one click on export, save as CSV, the data returned are in wrong date format.. Even if the source data and the visualisation are ok..

"date","openg1","lowg1","highg1","closeg1","volumeg1" "2017-12-27","44.6","44.6","44.6","44.6","5" "2017-12-27","44.6","44.6","44.6","44.6","0" "2017-12-27","44.6","44.6","44.6","44.6","5"

scholtz avatar Feb 15 '18 15:02 scholtz

Hey,

Sorry for not getting back earlier. GitHub issues is not covered by our regular support.

connect is for line graphs. Enabling it will connect two most adjacent data points over gaps.

Whereas you have candlestick graphs, so connect is simply ignored.

If you want the chart to not show gaps for hours that do not have data for, then you should add equalSpacing: true to categoryAxesSettings:

"categoryAxesSettings": {
  "minPeriod": "hh",
  "maxSeries": 1000000,
  "equalSpacing": true
},

Here's your chart with the above - no gaps:

https://codepen.io/team/amcharts/pen/77a5d42e338c109ef21633c59b719b5b?editors=0010

Hope this helps.

martynasma avatar Feb 28 '18 06:02 martynasma

Hi, the point was not to add the zero moving data to gaps, but to connect the gaps..

So the equal spacing = false, and connect = true is expected behavior as the gaps ub data are intended but not expected to be shown..

Is there some way to do it on the candlestick chart?

scholtz avatar Mar 15 '18 11:03 scholtz

Hi there,

I must admit I'm at a bit of loss as what you are trying to achieve. How can connecting of gaps with candlesticks work? Would you expect a single candlestick to grow wider to cover the gap?

martynasma avatar Mar 27 '18 14:03 martynasma

Hi, no, expected result is following:

This candlestickbar: {"date":new Date("2017-12-27T18:00:00+00:00"),"openg1":44.60000000,"lowg1":44.60000000,"highg1":44.60000000,"closeg1":44.60000000,"volumeg1":0}

should be right next to this candlestick bar:

{"date":new Date("2017-12-28T08:00:00+00:00"),"openg1":44.60000000,"lowg1":44.60000000,"highg1":44.60000000,"closeg1":44.60000000,"volumeg1":0}

with no gap time visualisasion..

the impact is that the line that distincts days may be different in width for different days

I expect the data I have provided to the chart to be visualised without any gaps. The issue the chart library may have is that some timepoints will not exists, so the x moving bar is not trivial to be displayed, but i believed it was able to achive this with the amcharts before i started the project. (because i believed it is quite common for financial data to be displayed without times when there is no trading time)

Also I have not noticed any response why my date "new Date("2017-12-28T08:00:00+00:00")" is trucated to 2017-12-28 for export.. Should i file this as another bug or is there some formatting option for the export?

Thanks

scholtz avatar Mar 29 '18 08:03 scholtz

Any suggestions?

scholtz avatar May 03 '18 07:05 scholtz