adessoSE / wicked-charts

Beautiful and interactive javascript charts for Java-based web applications.
Apache License 2.0
90 stars 48 forks source link

Serialize Point.y when null #31

Closed thombergs closed 8 years ago

thombergs commented 10 years ago

Reported by sebastien.gautrin, Apr 9, 2014 Objective: generate a graph with one line series where

Highcharts' wise, this means:

See this fiddle: http://jsfiddle.net/J99MA/ This other fiddle is with using complete points instead of defining categories on xAxis: http://jsfiddle.net/J99MA/1/ When y: null is omitted, Highcharts will then not be able to draw the series as a line or spline series, and will draw it as a scatter plot (i.e. with no point connection).

With wicked-charts' implementation, setting null y on points with no data can be done with using CoordinateSeries or even SimpleSeries. However as we need to be able to set the marker attribute on points, we need to use PointSeries (unless I missed something).

However, with PointSeries, we can't specify y: null as Point has no specific Serializer and thus uses the default of suppressing null when serializing.

To circumvent the problem I overloaded the Point class in my project to add @JsonInclude(value = JsonInclude.Include.ALWAYS) on the y attribute, but that doesn't feel right.

Note: this is with wicked-charts 1.5.0 for wicket 1.5 (wicked-charts-wicket15:1.5.0).

sgautrin commented 10 years ago

Nice thanks. Didn't realize the project had moved to GitHub; next bug reports will go there directly ;)