"Histogram by Percentage"
JKLONDON
New Altair Community Member
Hi how do I configure histogram plot so its done on % and not frequency? sure I am missing something very obvious :-\
Thanks
JK
Thanks
JK
Tagged:
0
Answers
-
Anyone? apologies if this is so obvious
Have figured out advanced charts this morning which is pretty cool but can get the Y axis to show as % instead of Count, if I need to manipulate the data then what do I need to do?0 -
It is not uncommon that questions in this forum are not answered immediately, especially if it is bedtime here in Germany.
Unfortunately it is not obvious how to use percentage instead of the absolute count. You will need a small hack and calculate the count in the "Aggregate" operator before. Here is an example process with generated data.
Than you can use use the advanced charts for the output and drop the "att1" attribute on the domain dimension, "percentage_count(att1)" on the numerical axis and select "Bars" in the visualization configuration after you have selected "Series: percentage_count(att1)".
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.009">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.3.009" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="generate_nominal_data" compatibility="5.3.009" expanded="true" height="60" name="Generate Nominal Data" width="90" x="45" y="30">
<parameter key="number_of_attributes" value="1"/>
</operator>
<operator activated="true" class="aggregate" compatibility="5.3.009" expanded="true" height="76" name="Aggregate" width="90" x="179" y="30">
<list key="aggregation_attributes">
<parameter key="att1" value="count (percentage)"/>
</list>
<parameter key="group_by_attributes" value="|att1"/>
</operator>
<connect from_op="Generate Nominal Data" from_port="output" to_op="Aggregate" to_port="example set input"/>
<connect from_op="Aggregate" from_port="example set output" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>0