I need plot title as Team vs col name - for-loop

Here I created list columns.
Then created for loop to make catplots of team vs column names
I need to show plot title as team vs col names inside for loop.
cols=['Score','WonGames','LostGames','TournamentChampion','Teams_Probability_of_winning']
for i in cols:
sns.catplot(x='Team',y=i,data=df,kind='bar', height=8,aspect=15/8)
plt.tick_params(axis='x', rotation=90)
plt.title(i,size=20)
plt.show()
Here it only show i means cols names as title.

Related

Can I make a circle/table graphic in SSRS and divide it by a passed number

I was asked to create a report (in SSRS visual studio 2019).
The report has the following table number, numeric. How many people per table (generally 4-12), names, etc and the order in which the people will sit. From this I'm being asked to create is a graphic visualization of a circle (broken out evenly by number of guests per table) in the order of which they are seated.
For example here is my data set:
I need to create a seprate page with the lists below so it would like like this
Page 1 would have this:
Table 1 - 8 Guests
Page 2 would have this:
Table 2 - 4 Guests
we can also use embedded images -- the team has an image for each table size but we still have to obtain the locations of each spot (which means we'd have to know how to divide a circle)
You can do this easily.
Add a list or single column table and the set Dataset property to your dataset name.
Change the row group (probably called "details") by adding a group that groups by table.
Now insert a pie chart into the table cell. We should now get 1 pie chart per table.
Click the pie chart and add a value entry, set the value expression to =1/countrows(), this bit will just split the chart up evenly based on the number of guests.
Set the category group to the guest field.
Right-click the chart and "Show data labels", then right-click the label and set the value to this expression =Fields!id.Value & " - " & Fields!guest.Value. Set the data label position property to "outside".
Finally click the chart and expand the "custom attributes" section, set the PieStartAngle property to 270, this will make sure the first person is immediately after the 12 o'clock position.
Oh,. and set the chart title to something like `="Table " & Fields!table.Value"
The final output looks like this...

Add notes & footnotes to table

I have a report where I need to add a note/number where a record has data in a particular column. I then need to add a reference to that to the bottom of the table, much like a footnotes section you would see in a book.
I've tried adding the rownumber but it pulls in the actual rownumber and not the record count. I'm using oracle for my db.
In my report, if the record has a value for the column RETURN_NOTE (not shown), then concatenate an int tot he end of the TASK_NAME column. Then underneath the table, add the int from above with the RETURN_NOTE value.
You can see the red numbers and their description in the image below.
Thanks
The best way to go here is when you add a calculated field to your dataset where you put your footnotes into the expression. Lets assume your footnotes depend on the Fields!Task.Value and lets call this calculated field Footnotes:
'Name: Footnotes
=Switch(Fields!Task.Value = "Prepare for Coordinator", 1, Fields!Task.Value = "Ready for Closeout", 2)
Now add another column to your tablix and put the field Fields!Footnotes.Value in this column.
Then add a rectangle or another tablix somewhere in your report (put in the values which explains the footnotes). Then go to the properties of this tablix/rectangle (pane on the right) and under Other > Bookmark write in a bookmark code (for example: FootnotesExplained).
Go back to your textbox with the Fields!Footnotes.Value in it and right click on this textbox and go to Text Box Properties > Action and check the Go to bookmark option and write below your bookmark code from before FootnotesExplained.
When you click now on one of the value in the column where the footnotes are the report will jump to the tablix/rectangle where your footnotes descriptions are.

OBIEE Pie graph - How to always display both actual and percent values?

I've created a pie chart and can see the data labels on rollover. On rollover, l can see the actual and percent values together, but after changing the data label display property from "on rollover" to "Always", It only shows me either the actual or the percent values.
How can I show both the actual and the percent values in the "Always on" data labels?
I've tried to adapt the xml, but I don't know the correct way to do so.
Here is a trick to show both...
But if you want a Legend, you must include the entity Names before the value and percent. The result will be that the pie values will have both the entity/grouping name, actual value (because now, for OBIEE, its part of the enitity name) and the percent.:
First, you must enter the graph properties of the Pie Chart:
Graph Properties (Click the xyz icon at the top-right of the Graph view in the Results tab).
Click Titles and Labels > Data Markers > Display
Ensure that Show Data Labels is set to Always.
Ensure that Display is set to Name and value.
Ensure that Change Value is set to Percentage of total.
Click OK > OK.
Now create a concatenated column and add it to the Pie chart (credit to Miky Schreiber's blog):
Add a new column (call it "concat").
Edit the new column's formula to be the concatenation of the entity--that the pie chart groups/slices by--and its measure value.
This is a string column, so you’ll need to convert the measure into string.
It will look something like this:
LOGICAL_TABLE.ENTITY_NAME || ' ' || cast(FACT_TABLE.MY_MEASURE as char)
Select the checkbox Treat as an attribute column > Click OK.
Now Edit the graph/pie view and in the Layout editor, drag the concat column under Slices and drag the measure under Slice Size. Optional: Select the checkbox Show in Legend.
Save your changes.

How to add a page counter to a report?

I am making a report for labels in Visual Studio. One of the parameters that the user enters is "label count," which produces the number of labels that the user chooses. The labels should be identical except for one textbox that reads "LABEL COUNT: X OF Y," where Y is the "label count" and X is the current label number, incrementing from 1 to Y. How can I implement this?
I've figured it out. This can be solved by inserting the contents of the label into a rectangle and then inserting that rectangle into a table. You will need to modify the code section of the table so that it creates a new page for each increment to the labelCount parameter. Then just insert a footer to the report to display the page count using the builtin page number variables.

Dynamic cell via parameter

I am trying to find how to do the following. I need to fill a string (a word) in a column that I can change from a table. Static way: Add Column > In formula ="FORD" So it fills all existing rows in the columns Variable way: If I change to HONDA the cell at the table, use  the new word in the query Thanks!
Something like https://stackoverflow.com/a/31522846/771768 will work:
Click on the Excel cell with HONDA, then open menu Power Query > Excel
Data > From Table (uncheck "My table has headers")
In the Power Query editor, right click on the HONDA cell of the table
and "drill down" to get the text value, and change your add column step to use this Column1
You can edit the value in sheet 1, and when you refresh your query
you'll see sheet 2 is changed.

Resources