Add second KPI to Qlik View distribution plot - qlikview

I am using a distribution plot in qlik sense desktop
Right now I have a
Dimension Point: Column A
Y-axis: column B
x-axis: column C
Right now I am only see the distribution of the x-axis in percentage, how can I add the absolute numbers to it?
how can I add another KPI to it that when I am moving over it with the mouse I also see another number ?

Related

why is ggplot2 geom_col misreading discrete x axis labels as continuous?

Aim: plot a column chart representing concentration values at discrete sites
Problem: the 14 site labels are numeric, so I think ggplot2 is assuming continuous data and adding spaces for what it sees as 'missing numbers'. I only want 14 columns with 14 marks/labels, relative to the 14 values in the dataframe. I've tried assigning the sites as factors and characters but neither work.
Also, how do you ensure the y-axis ends at '0', so the bottom of the columns meet the x-axis?
Thanks
Data:
Sites: 2,4,6,7,8,9,10,11,12,13,14,15,16,17
Concentration: 10,16,3,15,17,10,11,19,14,12,14,13,18,16
You have two questions in one with two pretty straightforward answers:
1. How to force a discrete axis when your column is a continuous one? To make ggplot2 draw a discrete axis, the data must be discrete. You can force your numeric data to be discrete by converting to a factor. So, instead of x=Sites in your plot code, use x=as.factor(Sites).
2. How to eliminate the white space below the columns in a column plot? You can control the limits of the y axis via the scale_y_continuous() function. By default, the limits extend a bit past the actual data (in this case, from 0 to the max Concentration). You can override that behavior via the expand= argument. Check the documentation for expansion() for more details, but here I'm going to use mult=, which uses a multiplication to find the new limits based on the data. I'm using 0 for the lower limit to make the lower axis limit equal the minimum in your data (0), and 0.05 as the upper limit to expand the chart limits about 5% past the max value (this is default, I believe).
Here's the code and resulting plot.
library(ggplot2)
df <- data.frame(
Sites = c(2,4,6,7,8,9,10,11,12,13,14,15,16,17),
Concentration = c(10,16,3,15,17,10,11,19,14,12,14,13,18,16)
)
ggplot(df, aes(x=as.factor(Sites), y=Concentration)) +
geom_col(color="black", fill="lightblue") +
scale_y_continuous(expand=expansion(mult=c(0, 0.05))) +
theme_bw()

How to plot histogram where a country is a bin

I am attempting to plot a histogram where the y-axis should be the count and the x-axis (i.e. the bins) should be composed of all the countries, but I cannot seem to figure out the code.
I have tried following https://datasciencelab.wordpress.com/tag/pandas/ and How to create Histograms in Panda Python Using Specific Rows and Columns in Data Frame, but both of those are for bar graphs and not for histograms.
per_country = df.groupby(['COUNTRY'])[['TOTAL']].sum()
per_country = per_country.sort_values('TOTAL')
per_country.head()
medals_per_country['TOTAL'].plot(kind='hist') # if hist is changed to bar, then it works, but I need a histogram and not a bar graph
The result should be a histogram where the x-axis includes a label for each country and the y-axis is the total for each country. Right now the bins are just based on the 'TOTAL', whereas the y-axis is the number of countries with said 'TOTAL'.
Can someone please point me in the right direction? Thank you!

Optimal display for overlapping series in a line chart

In a context of a line chart displaying time data in regular intervals where multiple series might overlap what would be the optimal way to:
A) hint the user that the chart has overlapping series?
B) give the user the capability to visualize all those series? Like spanning the series somehow?
For overlapping series in a line chart, I would keep the traditional line chart but put a label at the end of the graph with a color legend. The legend and label will help the user get information quickly.
Another version of a line chart for overlapping series can be a line area chat.
If you are not stuck on only line charts, I would suggest a bar chart. Below are some examples that you can use.
Example 1:
Example 2:
Example 3:
There are couple ways to indicate that there are overlapping series on a chart. You can increase the marker radius of one of them. The number of legend elements tells you how many series there is, too. Finally, you can distribute series on a different yAxis, with different top and height properties. Also, in styled mode, when you hover on legend item, other series opacity changes.
API Reference:
http://api.highcharts.com/highcharts/plotOptions.line.marker.radius
Examples:
http://jsfiddle.net/whsgpdyw/ - changing marker radius
http://jsfiddle.net/fuq6j4sg/ - each series on a different yAxis

2 category axis in Column chart in Webi Reports

Is it possible to have 2 category axis(x -axis) values one with bar and other with line and one measure for both? If possible please let me know how to achieve it.
Thanks
Niki
Multiple Y-axis are possible, but you can only have one X-axis per chart. That said, you can have an X-axis with multiple dimensions on it (e.g. City and State).
Each measure will be plotted (aggregated) according to the dimensions added to the X-axis.
You cannot have different visualisations for the same measure on the same chart (e.g. a column and a line for the same measure), unless you have a chart with 2 Y-axis. Whether this would be a good visualisation of your data is a different matter.

How to change text of y-axes on a matplotlib generated picture

The page is
"http://matplotlib.sourceforge.net/examples/pylab_examples/histogram_demo_extended.html"
Let's look at the y-axis, the numbers there do not make any sense, could we change it to something else that is meaningful?
Except the cumulative distribution plot, and the last one, the rest of the y-axes data show normalized histogram values with normed=1 keyword set (i.e., the are underneath the histogram equals to 1 as in the definition of a probability density function (PDF))
You can use yticks(), see this example.