amcharts / amcharts3

JavaScript Charts V3
Other
395 stars 129 forks source link

"Smoothed Line" Chart messing up curves #252

Open GeroSalas opened 4 years ago

GeroSalas commented 4 years ago

I'm following your docs at: https://www.amcharts.com/docs/v3/reference/amgraph/#type_property and https://www.amcharts.com/docs/v4/chart-types/xy-chart/#Smoothed_lines to get a "smoothed line chart" correctly, but it seems something is wrong internally at the library since it is messing up the curves and it looks really bad.

(EXPECTED) I'm trying to get something like this: expected

(ACTUAL) but I'm getting this: actual

Here I shared a JSFiddle to check my code.

What is going on here?

NOTE: I'm using amCharts v3

xorspark commented 4 years ago

As mentioned in your SO post, try setting equalSpacing to true in the categoryAxis object to work around this.

Updated fiddle

GeroSalas commented 4 years ago

cool! thanks @xorspark! that seems to work on a single chart very well... buut when I tried that on a multiple chart with many lines plotted it still getting messed up :/ look at this (pay attention to the "pink" line): image

any ideas here?

xorspark commented 4 years ago

Assuming you're using equalSpacing, your data is sorted and grouped in ascending order, and the minPeriod is set correctly, there's not much else to suggest outside of not using smoothedLine in v3 or moving to v4 where this works correctly.