SVG Documentation PDF
SVG Documentation PDF
Tomasz Pawiłojć
TABLE OF CONTENTS
Bar Chart 4
Gauge Chart 7
Half-Doughnut Chart 8
Horizontal Bar 9
Horizontal-Group Chart 14
Pie Chart 15
Ring Chart 17
It is just a workaround… 25
• Sparkline and Spark Bar Chart – Piotr Janeczek & Vincent Vikor
All the above metrics can be found in the Excel file, alongside definitions, requirements and code
generator.
Below, there is a description of numerous svg metrics, that can be used to create
visualizations. If it is not stated otherwise, all of them should be used inside grid.
Bar Chart
This is the easiest metric presented in the document. The bar is created by writing ASCII
character █ (ASCII code 219) chosen number of times, next to each other. It is possible to format
the color and alignment within the dossier by selecting format of the grid, and then values.
Pros:
Cons:
• Space between ASCII characters can be visible – especially when the dossier is exported to
PDF
This visualization works best if we have 3 metrics, for example: Actual Value, Last Year’s
Value and Target Value. They are represented, in order, by dark thin bar, light thick bar and small
black line. Colors as well as number format, can be customized.
Pros:
• In MicroStrategy 2020, we do not have Bullet Chart Visualizations and it is often required
by a customer
Cons:
• Understanding the code is necessary if you want to change anything besides metric
The above visualizations is similar to the previous one in many ways (both are Bullet Charts).
The main difference is the background – here it is not one (Last Year’s Value) but 3 metrics, defining
thresholds for Low, Medium and High Value. Everything can be customized by the user in excel file.
Pros:
• Again, in MicroStrategy 2020, we do not have Bullet Chart Visualizations and it is often
required by a customer
Cons:
• Understanding the code is necessary if you want to change anything besides metric
Gauge charts are often a required visualization by a customer. They present the fulfillment
of a target or another metric, that is between 0% and 100%, and can have bands applied (like Very
Bad, Bad, Good, Very Good).
Pros:
• In MicroStrategy 2020, we do not have Gauge Chart Visualizations and it is often required
by a customer
• It is working on iOS
Cons:
• Understanding the code is necessary if you want to change anything besides metric
names and colors
Half-Doughnut, like a gauge, presents a percentage metric (i.e. fulfillment of the target)
on a curved bar, with an exact number below. This visualization can be created in two versions –
with rounded curve, or not. The colors of the bars are showing how good the performance was,
and are possible to be changed.
Pros:
• Has a value instead of big arrow so this visualization is a lot more useful than gauge
Cons:
• Understanding the code is necessary if you want to change anything besides metric
names and colors
Similar to the Bar Chart. The main difference is that here we are not using ASCII character
to draw a bar, but svg code. The code is simple, and visualization is working on every device.
Pros:
• Easy to use
Cons:
This metric is based on the previous one. What is added here, are metric values in the middle
and opacity (the bar is darker for greater values). Last feature may be problematic on IOS – we need
to make sure that color-opacity is between 0% and 100%. So it should be used here if there is no
leader with a huge advantage.
Pros:
• Adding metric value in the middle may be better than at the end or next to
Cons:
• Having a leader with a huge advantage may result in huge differences between bar
lengths and colors
This visualization (both versions of it) may be really useful for presenting completion of the
forecasted target. However, it doesn’t look good when percentage of completion is extremely low
or high. What is more, even though visualization is working on iOS, formatting may be problematic
– the whole bar is often small, despite looking well in chrome. It also requires changes within the
code of the metric.
Cons:
• A lot of changes have to be hard coded, so without understanding the code of the metric
it may be hard
MicroCharts are visualizations that MicroStrategy has in Document, but not in Dossier.
Customers often ask for them, so the visualization seen above is some workaround, that gives
possibility to imitate MicroCharts. This metric should be used on compound grid (rather than
standard one). It requires only one metric and a time attribute (year, quarter, month).
Pros:
Cons:
• Complex code, so making any changes may be problematic (for example space between
bars)
The above visualization is a great way to show data, in case you have both, negative and
positive values of some metric (for example some YoY Growth). Like it was said regarding
previous visualization, MicroCharts are often required (or just really useful) and we don’t have
them in the Dossier.
Pros:
Cons:
• Complex code, so making any changes may be problematic (for example space between
bars)
The original Pie Chart is a standard MicroStrategy visualization, but sometimes it may be
useful to put it inside the grid, as a MicroChart. It is another way of showing fulfillment of the
target or a metric that can be put on a scale from 0% to 100% (like happiness on the screen
above).
Pros:
Cons:
A Radial/Circular Bar Chart is simply a Bar Chart plotted on a polar coordinate system,
rather than on a Cartesian one. This visualization looks really cool, however it may be misleading.
Longer bars not always mean greater value, because here the angle is the most important
indicator.
Pros:
Cons:
• May be misleading
Ring charts, like Horizontal Forecast before, may be used to present fulfillment of the
target. Here, the percentage of meeting the target is presented. Unfortunately, problems on iOS
with formatting may occur in that case (i.e. very small ring).
Pros:
• More flexible than Pie Charts (with ring option) in terms of thickness of the ring.
Cons:
• Complex code and some formatting (text and ring) must be done there
Sparkline is a very small line chart, presenting the general shape of the variation (typically
over time) of some measurement. It gives a general overview of the trend. We have that
visualization in a Document, but not in a Dossier and customers often requires it. That’s why
adding sparkline here was extremely important. Spark Bar is a bar chart version of a Sparkline.
Pros:
• Has tooltips
The excel file gives possibility to make some changes to the metric without understanding
the code. Below there is an example of how to use it and create SVG metric by yourself.
To use that visualization, we need 3 metrics. Bullet Chart is often used to show value
versus Last Year and Target. In our case, let’s suppose we want to present profit metric as Bullet
Chart. Then we need to go to excel file and see:
These are some basic information about metric, along with requirements. It may be good to look
at it to understand what we need to use it. Next column is a code:
You can skip it, if you want. However, it may be useful to understand the code to be able to make
more changes in the future. It is not required though to be able to use it, so we can go to the next
column set:
The only thing that is left, is to drag and drop the created metric to the grid. You can also add
attributes – for example to show Profit by Call Center.
To use that metric we need only 2 metrics (which is rather 1 metric and 100% minus that
metric). However, it is more complicated than the previous one, because this time we will create 3
new derived metrics. As you can see, below Ring Chart picture there is a lot of space:
The first step is easy – we need to copy the CSS code from generator column and paste it in
dossier, in metric creator. Remember to name that metric CSS. Then, we can concentrate on the
“donut” part.
SVG metrics are really useful in many cases. However, there are some limitations and
problems with them. Some of them were mentioned before, so below is a whole list with more
detailed explanation.
This is the most challenging and important problem. A lot of metrics magically disappear
when opened in a dossier on IPad. It is a well-known problem, without a simple solution. It lays in
a code and the fact that IOS is less tolerant with some small mistakes. For example, when you
define a color like ‘ #1fb2e5’, web browser won’t take into consideration the additional space in
the beginning. However, on IPad it won’t work, and you will the custom color applied (probably
black). There are other problems, enumerated below:
• When defining y value within the code, it cannot be a percentage – it has to be a number
value
• When defining the font, instead of writing “font: bold 10px sans-serif; fill: white;”, we need
to write a full version “font-size: 10px; font-weight: bold; font-family: sans-serif; fill: white;”
• Fill-opacity of the rectangle must be between 0% and 100%. In web browser, greater
values are treated as 100%, when on IOS 145% looks like 45%
• Scale on IPad is completely different. For example, while using Ring Chart, in web browser
everything looks fine. However, on IOS the visualization is extremely small. If we get rid of
“fit to container” option for rows, and use fixed instead, the size goes back to expected
one but it looks like zooming small picture – so the text looks terrible.
The purpose of the whole project was to make svg metrics more known and use them
without understanding the code, just by using generator. It is possible right now, however like
always, not every change can be done in the code generator. There are to many variables and
including them would make the file unreadable. In standard cases, the generator should be
enough. However, we strongly encourage to read and understand what stands in code over time.
It will give you possibility to make more changes and customize it as you need/like.
It is just a workaround…
Like the title says, svg metrics are just workaround to get the visualizations we need or
customer asks for. They won’t work as standard Bar or Line Chart, so we would just have to drag
and drop attributes and metrics to get visualization, which can be further formatted. Here, most
of the work is done in code, which makes it more flexible, but a lot harder to understand and
read. Sometimes an unnecessary space or comma can make whole metric validated but not
working, and we will spend hours looking for that bug. C’est la vie!