Search code examples
javascriptshieldui

Adjusting Shield UI JavaScript chart when NULL values are present


I am using Shield UI JavaScript chart to show some monthly data to my visitors. However the available data doesn’t always equal 12 months. On the other hand I have categorical values on my X axis; January, February and so on. I am using a line chart type and for months where there are no adjacent values I do get a point which makes my chart to look some messy. I tried to adjust the

seriesSettings: {
line: {
    drawNullValues: true
}
}

property, however the look remains. Any ideas?


Solution

  • Since you have categorical values – the names of the 12 months, it wouldn’t make much sense using the drawNullValues. This is because once there is a values (even null) for a point, it takes it’s place on the X axis.

    Your chart will look much better, if you use the appropriate type- let’s say bar so that data is easy to see and months with and without data will be easy to distinguish.