how to align chart + html.table in a Plotly Dash app? - html-table

I'm trying to reproduce a layout where the table and the chart should be aligned as in the image below:
The main idea is to work for 1 to N values, always aligned to each other.
I tried to create a "fake" graph inside the table but as you can see in the image below it doesn't work exactly as expected
So I would like to know what's the best way to:
1- calculate and set the size needed for each bar in the graph
2 - set it dynamically based on how many entries the data has
3 - Don't forget please, ALWAYS ALIGNED
IF needed I can share the code of the table or of the layout graph + table I'm using;
Thank you in advance.
Regards,

Related

How to add descriptions on selected data series to an area plot in mathplotlib

I created a graph that looks alright to me with the following line of code:
df_wide.plot.area(xticks=df_wide.index, legend=False, xlabel= 'Week', ylabel='Percent', title='Percentage of Letters')
However I would like to add the name of selected (or all) dataseries to the right side of the Graph, so that it attaches little lines to the right side and the column name appears next to it, I attach a picture with my current output and how I want it to look (not exactly well edited, but I am sure you get the idea)...
Maybe somebody can helb me :) Thank you!

Is there any built in function in pandas to subtract various columns to manipulate a stacked bar chart?

I hope I do not brake too much rules (this is my first post).
First Things first: I'm sorry, but I cannot post an image of my plots or Code right now. So I created a pretty image in paint. On the left side you see what I want to create, on the right side you see what I create right now.
Example
I was able to make a barchart as shown on the left side with lots of detours. Since I have to analyse lots of data in similar charts I want to use the built in plot function of Pandas.
What I need: stacked bar chart, where the values are not summed up (like shown in the right image) but the difference of the values are summed up (like shown in the left image). So if s1 = 2 and s2 = 6 and i just do some stuff like groupby().unstack().plot(kind='bar', stacked=True) I got stacked bars which end at y=2 for s1 and y=8 for s2 (like shown in the right diagram).
How can I modify my code so that I will get y=2 for s1 and y=6 for s2?.
I thought about diff(), but the result was definetly not like expected.
I hope my question is clear.
Thanks for your adviced and best regards
Arnfried

Highcharts: Polar columns datalabels inside position

I'm trying to get values (datalabels) of a columns polar chart INSIDE the actual column, and not on top of it. I've set inside: true property but it does not seem to have any effect, although it works pretty nicely while using a regular stacked columns chart for example.
Here is the fiddle showing the issue: http://jsfiddle.net/deurk/BeVyt/2/
Ideally, I'd like to have the datalabels in their "shares" if there is enough space, with white color. Does anyone have a workaround for this?
Thanks!
Indeed it looks like a bug, so I've reported it here https://github.com/highslide-software/highcharts.com/issues/1688

dojox.charting: how to align the plotArea of 2 charts, one above another?

I'm trying to layout 2 linked charts, one above the other, similar to what you might see on the Google Finance page.
I can render both charts just fine, but getting the plotAreas to line up exactly is a bit of a mystery. The chart.plotArea.width of each chart seems to depend on the width of my Y axis labels. Thus the 2 charts are not the same width and have different values for chart.getCoord().l.
Right now, I'm using an offset which is manually calculated, but there must be a better way.
this.chart.render(); // top chart, getCoords().w=800
// manually set margins for lower chart to match
this.chartVol.margins.l = this.chart.offsets.l - 59 + 10;
this.chartVol.margins.r = this.chart.offsets.r - 31 + 10;
// render bottom chart
this.chartVol.render(); // bottom chart same width, getCoords().w=800
There are two simple ways to do it:
Use maxLabelSize and labelFunc. The former is the maximal label's size in pixels. The latter is a function, which takes a number, and returns a corresponding string label.
Use labels, which is an array of {value, text} objects, and include one long dummy string of desired size at the end with some bogus value.
I don't recall how to do it without custom labels, so if you feel like it is really needed, please submit an enhancement ticket.

SSRS 2005 with matrix and list shows blank page between every data page when printing or exporting to PDF

I am using SQL Server Reporting Services 2005 - I have created a portrait A4 report 8.5in by 11in.
The report consists of a header, body and a footer.
The body consists of a number of textboxes in a 2 column layout and underneath them a matrix placed onto a list.
The matrix consits of 2 fixed rows (with 1 fixed textual column in the top row and 2 dataset field columns in the bottom one) and a number of columns (each with a width of 0.875in and data taken from different dataset fields). I use the group expression =Ceiling(RowNumber(Nothing)/5) on the list, to make the matrix columns start below the previous ones every 5 repeated columns.
The problem I am facing is that a blank page (with only header and footer) is appearing between every page of report data when I export the report to PDF or print it physically, if the matrix spans more than one page of data. There is plenty of room for the columns of the matrix on the page. I have tried the following, but to no avail:
1) I checked that Page Width (8.5in) >= Body Width (7.20833in) + Left Margin (0) + Right Margin (0)
2) I checked that Page Height (11in) >= Page.TopMargin (0) + Header.Height (2in) + Body.Height (6.60417in) + Footer.Height (0.89583in) + Page.BottomMargin (0)
3) I played around with various margin values, ranging from 0in to 0.5in for the left, right, top and bottom margins.
4) I set all textboxes' CanGrow property to false. This also has the undesirable effect of chopping out the text when it cannot fit, but even so, the blank page problem still occurs.
5) I placed the list and the matrix together in a rectangle with the blank space (to the right of the matrix) outside the rectangle.
The only thing that stops the blank pages from appearing is changing the list grouping expression to =Ceiling(RowNumber(Nothing)/2), i.e. make the matrix start a new "table" every 2 repeated columns (rather than 5). This, however, I do not understand, as there is plenty of space for 3 other columns to their right and it is odd and untidy to just put 2!!
I would greatly appreciate any help in this!
Thanks in advance!
Tim
For anybody who is having a similar problem in SSRS 2008, I found the only way to fix this was to set the property named ConsumeContainerWhitespace on the Report itself to true.
In my case the issue was that the matrix on the page was narrow in design mode with a lot of whitespace to the right. When rendered, the matrix was rendered much wider (due to the data) but the renderer would also include the whitespace, causing the report to be much wider than the actual page.
If you set this property, the extra whitespace does not get rendered.
If I understand you correctly I've solved this problem before. The matrix claims extra white space, the solution I used is as follows:
You need to consume the white space.
[-------page width------]
[matrix][-textbox hack-]
I think you can set the textbox to be invisible
Note: When I attempted this in 2005, it only worked when the invisible textbox spanned the entire line.