Search code examples
angularjsamcharts

AM charts plots on the wong position


Am charts plots lines some lines on the wrong y-axis position. see code and snapshot bellow.

My graphs:

[{"bullet":"none","labelsEnabled":false,"dashLength":0,"lineThickness":3,"title":[["Tonnes Milled"]],"valueField":"TonnesMilled","balloonText":"[[value]]","valueAxis":"LeftAxis","numberFormatter":{"precision":2,"decimalSeparator":".","thousandsSeparator":","},"lineColorField":"Color"},{"bullet":"none","labelsEnabled":false,"dashLength":0,"lineThickness":3,"title":[["Total Magalies Water PPM"]],"valueField":"TotalMagaliesWaterPPM","balloonText":"[[value]]","valueAxis":"LeftAxis","numberFormatter":{"precision":2,"decimalSeparator":".","thousandsSeparator":","},"lineColorField":"Color"},{"bullet":"none","labelsEnabled":false,"dashLength":0,"lineThickness":3,"title":[["Water Average Daily Consumption"]],"valueField":"WaterAverageDailyConsumption","balloonText":"[[value]]","valueAxis":"LeftAxis","numberFormatter":{"precision":2,"decimalSeparator":".","thousandsSeparator":","},"lineColorField":"Color"},{"bullet":"none","labelsEnabled":false,"dashLength":0,"lineThickness":3,"title":[["Water Consumption M3/ton"]],"valueField":"WaterConsumptionM3Ton","balloonText":"[[value]]","valueAxis":"LeftAxis","numberFormatter":{"precision":2,"decimalSeparator":".","thousandsSeparator":","},"lineColorField":"Color"}]

My data:

[{"TotalMagaliesWaterPPM":236458,"WaterAverageDailyConsumption":7627.677419354839,"WaterConsumptionM3Ton":0,"Date":"Jan - 2019","TonnesMilled":0,"DateConverted":true},{"TotalMagaliesWaterPPM":236459,"WaterAverageDailyConsumption":8444.964285714286,"WaterConsumptionM3Ton":0,"Date":"Feb - 2019","TonnesMilled":0,"DateConverted":true},{"TotalMagaliesWaterPPM":236460,"WaterAverageDailyConsumption":7627.741935483871,"WaterConsumptionM3Ton":0,"Date":"Mar - 2019","TonnesMilled":0,"DateConverted":true},{"TotalMagaliesWaterPPM":236461,"WaterAverageDailyConsumption":7882.033333333334,"WaterConsumptionM3Ton":0,"Date":"Apr - 2019","TonnesMilled":0,"DateConverted":true},{"TotalMagaliesWaterPPM":236462,"WaterAverageDailyConsumption":7627.806451612903,"WaterConsumptionM3Ton":0,"Date":"May - 2019","TonnesMilled":0,"DateConverted":true}]

Pay attention to the blue lines mostly:

Sample:

sample

Another Sample:

another sample


Solution

  • Problem is your date format. You try to give your dates MMM - YYYY format, but chart do not know this and and render all of them as Jan 2019. Check this:

    Formatting dates on category axis | amCharts3