0 Replies Latest reply on Oct 18, 2019 8:33 AM by 2885390

    bug in line chart some series are not drawn

    2885390

      I am making a Line of Ballance chart using <oj-chart type="line"

      As you can see some of the lines are not drawn.

      I am using the following template

      here is the input data

        [

            {

              "id": 0,

              "series": "Walls1",

              "object": "Walls", 

              "date": "2014-06-07T08:00:00",

              "value": 0,

              "location" : "House1",

              "team" : "John's Concrete Monkeys"

            },

            {

              "id": 1,

              "series": "Walls1",

              "object": "Walls", 

              "date": "2014-06-08T08:00:00",

              "value": 1,

              "location" : "House1",

              "team" : "John's Concrete Monkeys"

            },

             {

              "id": 2,

              "series": "Walls2",

              "object": "Walls",

              "date": "2014-06-09T08:00:00",

              "value": 1,

              "location" : "House1",

              "team" : "The rude extruders"

            },

             {

              "id": 3,

              "series": "Walls2",

              "object": "Walls",  

              "date": "2014-06-16T08:00:00",

              "value": 2,

              "location" : "House1",

              "team" : "The rude extruders"

            },

            {

              "id": 4,

              "series": "Walls3",

              "object": "Walls",  

              "date": "2014-06-16T08:00:00.000",

              "value": 2,

              "location" : "House1",

              "team" : "The Concrete Excreters"

            },

            {

              "id": 5,

              "series": "Walls3",

              "object": "Walls",  

              "date": "2014-06-23T08:00:00.000",

              "value": 3,

              "location" : "House1",

              "team" : "The Concrete Excreters"

            },

            {

              "id": 6,

              "series": "Walls4",

              "object": "Walls",  

              "date": "2014-06-23T08:00:00.000",

              "value": 3,

              "location" : "House1",

              "team" : "The Wall Wallies"

            },

            {

              "id": 7,

              "series": "Walls4",

              "object": "Walls",  

              "date": "2014-06-30T08:00:00.000",

              "value": 4,

              "location" : "House1",

              "team" : "The Wall Wallies"

            },

            {

              "id": 8,

              "series": "Walls5",

              "object": "Walls",  

              "date": "2014-06-30T08:00:00.000",

              "value": 4,

              "location" : "House1",

              "team" : "The Moldy Moulders"

            },

            {

              "id": 9,

              "series": "Walls5",

              "object": "Walls",  

              "date": "2014-07-07T08:00:00.000",

              "value": 5,

              "location" : "House1",

              "team" : "The Moldy Moulders"

            },

            {

              "id": 10,

              "series": "Walls6",

              "object": "Walls",  

              "date": "2014-07-07T08:00:00.000",

              "value": 5,

              "location" : "House1",

              "team" : "Lament the Cement"

            },

            {

              "id": 11,

              "series": "Walls6",

              "object": "Walls",  

              "date": "2014-07-14T08:00:00.000",

              "value": 6,

              "location" : "House1",

              "team" : "Lament the Cement"

            },

             {

              "id": 12,

              "series": "Floors1",

              "object": "Floors",  

              "date": "2014-06-09T08:00:00",

              "value": 0,

              "location" : "House1",

              "team" : "John's Concrete Monkeys"

            },

             {

              "id": 13,

              "series": "Floors1",

              "object": "Floors",

              "date": "2014-06-15T08:00:00",

              "value": 1,

              "location" : "House1",

              "team" : "John's Concrete Monkeys"

            },

            {

              "id": 14,

              "series": "Floors2",

              "object": "Floors",

              "date": "2014-06-16T08:00:00.000",

              "value": 1,

              "location" : "House1",

              "team" : "The rude extruders"

            },

            {

              "id": 15,

              "series": "Floors2",

              "object": "Floors", 

              "date": "2014-06-23T08:00:00.000",

              "value": 2,

              "location" : "House1",

              "team" : "The rude extruders"

            },

            {

              "id": 16,

              "series": "Floors3",

              "object": "Floors",

              "date": "2014-06-23T08:00:00.000",

              "value": 2,

              "location" : "House1",

              "team" : "The Concrete Excreters"

            },

            {

              "id": 17,

              "series": "Floors3",

              "object": "Floors", 

              "date": "2014-06-30T08:00:00.000",

              "value": 3,

              "location" : "House1",

              "team" : "The Concrete Excreters"

            },

            {

              "id": 18,

              "series": "Floors4",

              "object": "Floors", 

              "date": "2014-06-30T08:00:00.000",

              "value": 3,

              "location" : "House1",

              "team" : "The Wall Wallies"

            },

            {

              "id": 19,

              "series": "Floors4",

              "object": "Floors", 

              "date": "2014-07-07T08:00:00.000",

              "value": 4,

              "location" : "House1",

              "team" : "The Wall Wallies"

            },

            {

              "id": 20,

              "series": "Floors5",

              "object": "Floors", 

              "date": "2014-07-07T08:00:00.000",

              "value": 4,

              "location" : "House1",

              "team" : "The Moldy Moulders"

            },

            {

              "id": 21,

              "series": "Floors5",

              "object": "Floors", 

              "date": "2014-07-14T08:00:00.000",

              "value": 5,

              "location" : "House1",

              "team" : "The Moldy Moulders"

            },

            {

              "id": 22,

              "series": "Floors6",

              "object": "Floors", 

              "date": "2014-07-14T08:00:00.000",

              "value": 5,

              "location" : "House1",

              "team" : "Lament the Cement"

            },

            {

              "id": 23,

              "series": "Floors6",

              "object": "Floors", 

              "date": "2014-07-21T08:00:00.000",

              "value": 6,

              "location" : "House1",

              "team" : "Lament the Cement"

            }

          ]

       

       

      Changing id 13

      to the 16th

      {

              "id": 13,

              "series": "Floors1",

              "object": "Floors",

              "date": "2014-06-16T08:00:00",

              "value": 1,

              "location" : "House1",

              "team" : "John's Concrete Monkeys"

            },

      and now the chart is drawn correctly

      The problem is that the polyline is wrong. It is two polylines with just one set of x y coordinates each  rather than one with two sets of x y coord.

       

      The problem lies in DvtChart.js

      DvtChartLineArea.prototype._renderLines

      when a call to this._getPointArrays(this._arCoord, this._type); is made

      If the array this._arCoord has data points next to each other e.g on pos 4 and 5 everything works OK.

      However for some of my series the data points ends up on e.g 4 an 6 than I get a problem

       

      So when I hit the following case the line will not be drawn correctly:

       

      I have solved this in my code by removing the null elements:

      DvtChartLineArea.prototype._renderLines = function() {

      var localarCoord = this._arCoord.filter((item)=>{

            if (item.x != null )

            return item ;

        });

        var pointArrays = this._getPointArrays(localarCoord, this._type);

       

      But it is hardly the right way to do it.

       

      The method _getPointArrays probbably needs a fix.