spotfiresoftware / spotfire-mods

Spotfire® Mods
https://spotfiresoftware.github.io/spotfire-mods/
Other
56 stars 41 forks source link

Marimekko Chart #95

Open linnosterlund opened 2 years ago

linnosterlund commented 2 years ago

This visualization is based on the simple bar chart implementation, and visualizes the data as either a marimekko or mekko chart. The marimekko chart is similar to a 100% stacked bar chart and the mekko chart is similar to a normal stacked barchart. The difference to a barchart is that there are four axes at work in this mod, two categorical axes, one for horizontal division and one for coloring, and two continuous axes that are the visible x and y axes and decide the width and height of the segments.

This mod allows the user to configure the chart in multiple ways, with settings accessible as usual in Spotfire as well as an options button visible only in the editing mode. The configurable options available are:

The tooltip displays the data of which it hovers over. When left clicking on a segment it is marked, and by holding ctrl or shift while clicking segments, markings are added on each clicked segment. Rectangle marking is also available by dragging the mouse until the visible rectangle covers all segments to be marked.

The image below shows the chart as marimekko to the left and mekko to the right. The dataset is a simple list of some values of four different products in four different states. The marimekko chart shows the percentages, and the mekko chart shows the titles of the categories. This picture is an old one, and the current visualization differs slightly with the most notable difference being the text color changing to white if the background is too dark.

marimekko-n-mekko2
hski-github commented 2 years ago

It is really great to see your Marimekko visualization. 😀 That was the next thing on my wish list, because it is really a new visualization capability.

Have you considered a non-100% percentage height? And how about showing the labels of the columns (like in the bar chart example for Column 1) rather than or in addition to numerical y axis?

linnosterlund commented 2 years ago

Glad that you liked it! This mod is currently under development, so it is not ready for use yet. When finished, you will be able to switch between the Marimekko chart type (100% height) and the Mekko chart type (columns height is relative to each other like a stacked bar chart). The mode of the axes will also be configurable, either numerical or percentage, and with or without labels.

hski-github commented 2 years ago

Really great! Are you planning also full Marimekko with two value axis (one for x, one for y) and two category axis (one for y and one colors axis for x axis stacked)?

linnosterlund commented 2 years ago

Sorry for the late reply. Yes the mod will have two category axis (the color axis and the horizontal category axis) as well as two value axis (x and y), so that it is possible to compare two values for categories.

hski-github commented 2 years ago

From feature perspective horizontal sort order would be an important feature for our use cases. 1) alphabetical / natural sort order according to the horizontal categorial axis AL, FL, NC, VB

grafik

2) sort by percentage of the horizontal categorial axis (ascending, descanding) 44.5 %, 27.5 %, 16.5 %, 11.5 %

grafik

3) sort by percentage of one of the color by values e.g. highest amount of Berries per state (ascanding, descanding) 36.4 %, 32.7 %, 27.0 %, 26.1 %

The last one 3) is for our use cases of the most value, because it represents a certain key parameter in the stacked bar.

Maybe for 3) it is not necessary to be able to select an individual value from color by axis e.g. Berries. Guess it is okay in case of 3) to sort by the first or last value e.g. Almonds or Potators. Maybe just sort by the bottom color value like Potators is fine. And if a user wants to sort by a specific value, he can influence by custom sort order or that parameter.

linnosterlund commented 2 years ago

Thank you for your input! It really helps to know what people might need with this mod so that I can make it as useful as possible. The sorting options available right now for this mod are sorting by the horizontal categorical axis and sorting segments within a bar. Both sort depending on value, and thus by percentage as well. I will update the description today with everything that has been added so that you can see what features the marimekko mod currently has. I think that some of your requests will be met by the newer additions.

I'm finishing my internship today however, so I won't be working as frequently on this mod anymore. But you are very welcome to work further on this! I will also check with my colleagues so that someone can take over this mod and continue with the final touches.

hski-github commented 2 years ago

Could you also share your test data which you used for the example screenshot?

hski-github commented 2 years ago

I am currently testing your Marimekko. It works really nice and you added a lot of functionality and possibilities to configure. Very well done! Really like what you have created here!

Some little issues I found during testing