fusioncharts / angular-fusioncharts

Angular Component for FusionCharts JavaScript Charting Library
https://fusioncharts.github.io/angular-fusioncharts/#/ex1
Other
55 stars 37 forks source link

Msspline chart showing wrong data #108

Closed GadepalliAditya1998 closed 3 years ago

GadepalliAditya1998 commented 3 years ago

I have been using msspline chart for showing multi-series data. If I show a single series the data is being represented correctly but when there is more than 1 series, the graphs show abnormal data.

FusionCharts.ready(function() { var visitChart = new FusionCharts({ type: 'msspline', renderAt: 'chart-container', width: '700', height: '400', dataFormat: 'json', dataSource: { "chart": { "theme": "fusion", "caption": "Number of visitors last week", "subCaption": "Bakersfield Central vs Los Angeles Topanga", "xAxisName": "Day", "yAxisName": "No. of Visitor", "showXAxisLine": "1", "xAxisLineColor": "#999999", 'decimals':'0' , 'adjustDiv':'0' }, categories: [ { category: [ { label: "Jan 1" }, { label: "Jan 2" }, { label: "Jan 3" }, { label: "Jan 4" }, { label: "Jan 5" }, { label: "Jan 6" }, { label: "Jan 7" } ] } ], dataset: [ { seriesname: "Received", data: [ { value: "0" }, { value: "0" }, { value: "0" }, { value: "0" }, { value: "0" }, { value: "0" }, { value: "0" } ] }, { seriesname: "Resolved", data: [ { value: "0" }, { value: "0" }, { value: "0" }, { value: "0" }, { value: "0" }, { value: "1" }, { value: "1" } ] } ] } }).render(); }); This is the data which I am trying to input

and the result is: image But when I select only 1 series by selecting on the legend filter: image image

Happens with data when values are near 0.

Can anyone suggest me a fix for this.

JSON Data: { type: 'msspline', renderAt: 'chart-container', width: '700', height: '400', dataFormat: 'json', dataSource: { "chart": { "theme": "fusion", "caption": "Number of visitors last week", "subCaption": "Bakersfield Central vs Los Angeles Topanga", "xAxisName": "Day", "yAxisName": "No. of Visitor", "showXAxisLine": "1", "xAxisLineColor": "#999999", 'decimals': '0', 'adjustDiv': '0' }, categories: [ { category: [ { label: "Jan 1" }, { label: "Jan 2" }, { label: "Jan 3" }, { label: "Jan 4" }, { label: "Jan 5" }, { label: "Jan 6" }, { label: "Jan 7" } ] } ], dataset: [ { seriesname: "Received", data: [ { value: "0" }, { value: "0" }, { value: "0" }, { value: "0" }, { value: "0" }, { value: "0" }, { value: "0" } ] }, { seriesname: "Resolved", data: [ { value: "0" }, { value: "0" }, { value: "0" }, { value: "0" }, { value: "0" }, { value: "1" }, { value: "1" } ] } ] } }

AyanBhadury commented 3 years ago

@GadepalliAditya1998 Please set minimizeTendency as 1 at the chart object-level, demo : https://jsfiddle.net/a368nq7b/

GadepalliAditya1998 commented 3 years ago

@AyanBhadury , Works like charm thank you so much