turnilo icon indicating copy to clipboard operation
turnilo copied to clipboard

`maxSplits` not honoured for line charts

Open fstolba opened this issue 3 years ago • 2 comments

When drawing a line chart (measurement vs. time), a time split needs to always be present. Adding a second dimension to the split works as expected, but as soon as one adds a third dimension, the error message Too many splits on the line chart appears. Judging from the docs I was expecting to be able to override this by setting the maxSplits parameter for the queried datasource. Setting this parameter does not change the described behaviour in any way though.

Is this expected behaviour? Is there an option to enable more dimensions for the line chart?

I understand that having too many splits would probably cause the diagram to get illegible very quickly and possibly have adverse effects on query performance. However I think there are legitimate use cases where supporting more than one dimension for line diagrams is desireable.

fstolba avatar Feb 12 '21 11:02 fstolba

Is this expected behaviour? Is there an option to enable more dimensions for the line chart?

Yes, it is expected behaviour but I admit that your confusion is understandable. I should work on better documentation around maxSplits. It is very technical knob and it was designed to handle very specific corner case.

However I think there are legitimate use cases where supporting more than one dimension for line diagrams is desireable

I can't imagine how we could draw multiple splits on line chart that would be understandable for user. Keep in mind that dimensions for turnilo are unrelated, so it has to handle two dimensions which are not correlated in any way. For example, how would you draw a line chart with dimensions "Gender" and "Nationality"? Should we draw line for each combination of values?

Show us some examples of good charts that can present such data and we can talk if it is possible to implement it in turnilo :)

adrianmroz avatar Feb 12 '21 11:02 adrianmroz

For example, how would you draw a line chart with dimensions "Gender" and "Nationality"? Should we draw line for each combination of values?

I was kind of expecting Turnilo to handle this the same way that Superset does, by creating a separate line for each of the combinations.

Let's take the following example: Gender: possible values m, f, x Region: Europe, USA, Asia

This would yield the following combinations, each of those would constitute an individual line displaying the magnitude of the current measure matching both criteria: Europe - m, Europe - f, Europe - x, USA - m, USA - f etc.

These combinations could also be split into multiple panels for better readability (like when displaying different measures). E.g. displaying a panel for Europe, containing all combinations of Europe with Gender, below it a panel for USA and so on.

I understand this has performance implications because of the explosion in possible values but this might be alleviated by adding sane default limits (e.g. calculating only top 3x3 combinations with regard to the current order, unless explicitly selected otherwise by the user).

fstolba avatar Feb 15 '21 08:02 fstolba