/
How to Set Data with Null Values in FlexCharts?
How to Set Data with Null Values in FlexCharts?
Context
We use a library named Wicked Charts for server side validation of the chart. Unfortunately this library doesn't support null values, even though they are valid for Highcharts.
Workaround
Replacing the null values by empty maps ("[ ]" in Groovy) will pass the validation successfully, and the final Highchart will look as if nulls had been provided.
A typical FlexChart that would fail due to nulls looks like this:
def chartDefinition = [
chart: [
type: 'column'
],
...
series: [
[
name : 'Series 1',
data: [null, null, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, null]
],
...
]
]
api.buildFlexChart(chartDefinition)
And this is the result after applying the workaround:
def chartDefinition = [
chart: [
type: 'column'
],
...
series: [
[
name : 'Series 1',
data: [ [], [], 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, []]
],
...
]
]
api.buildFlexChart(chartDefinition)
, multiple selections available,
Related content
How to Add a Gauge Chart to Line Detail and Header
How to Add a Gauge Chart to Line Detail and Header
Read with this
FlexChart Templates
FlexChart Templates
More like this
How to Create Revenue Waterfall Dashboard
How to Create Revenue Waterfall Dashboard
Read with this
FlexChart Examples
FlexChart Examples
More like this
How to Deal with Analytics Data Table's UI Responsiveness
How to Deal with Analytics Data Table's UI Responsiveness
Read with this
How to Display Large Number of Data Points in FlexChart Scatter Plot
How to Display Large Number of Data Points in FlexChart Scatter Plot
More like this
Found an issue in documentation? Write to us.