Simplecharts: combined bar - line chart

1
I'm facing the problem of having to produce a graph in which the first series is shown as a horizontal bar and the second series as a linechart. I'm using the Simple Charts widget. In this widget it is -to my believe- not possible to set this from within the Modeler. Does anybody know of a way to make this happen from within Simple Charts? I already tried putting in extra JSON options, but I'm not sure how to 'talk' to the generated series, since their name gets generated from within Mendix. Any help would be welcome!
asked
3 answers
0

I'm not sure about Simple Charts, but I know with HighCharts (part of SimpleCharts) you can combine multiple graph types, although a UI currently isn't built out for the SimpleCharts widget. If you want to do you own customization, I would suggest checking out http://api.highcharts.com/highcharts.

Otherwise, you'll want to file a feature request.

Also, to confirm the what you said, JSON options do not allow you to insert new series, nor would that information be dynamic anyway.

answered
1

It is possible to use if statements in the extra options field of the simplecharts widget using Highcharts. I based my if statement on the series.name to change the contents of the tooltip per series. You should try if this also works for series types. Else you'll have to edit the widget code.

tooltip: {
            formatter: function() {
                var text = '';
                if(this.series.name == 'Name of your series') {
                    text = 'Tooltiptext';
                } else {
                    text = '<b>'+ this.series.name + '</b><br/>' + this.point.labelx +': ' + this.point.labely,0;
                }
                return text;}}
answered
1

A patched version of the simplechart widget can be found here. Note that the series objects have a type per series. Only the flot implementation is changed. No support.

answered