Winforms pie chart label text truncated - winforms

I'm using VS2019 and the default Winforms Pie Chart.
The legend appears as in the attached image.
I've tried playing with the chart size, and the larger I make the chart, the less truncated the legend text becomes, but it's going to have to be huge to fit it all in...
Any ideas why and how to change that so it's never truncated regardless of text length or chart size?
Thanks
EDIT:
Looking at the TextWrapThreshold and IsTextAutoFit properties of the Legend, the text is still graphically truncated, although it seems it is being "wrapped" like specified. This is still an undesired result..
What other solution is there besides enlarging the chart..?

#Yafim I'm moving the answer here because I need to post some images. You mean this is happening?
If this is the case, and you don't want the full legend text to appear inside the sections of the doughnut (because they are overlapping the doughnut itself), you can show the values only by setting the Series->Label->IsValueShownAsLabel property to true and get something similar to this:
Not sure if this was your problem, (you already showed in you photos you know about this)...

Related

SSRS Report Designer Cutting off Column Chart in Print Layout

I have a problem with my rdl report cutting off the column chart I put in when viewing it in print layout. The layout of the page is correct as no additional pages appear in the print layout.
I have a column chart that consists if 11 columns (categories) and it only seems to display 9 and half of the tenth off. It does not matter if I put the page orientation in landscape of portrait, the same problem exists. It also does not matter what size I make the chart, it seems to cut of the last column in print layout.
When I export the file to pdf then it works perfecty.
Can anyone assist me please?
Kind Regards
You can try to change size of the print page and orientation. press F4 on Design screen, you will see properties bar. There is a button (looks like a wierd spaceship or key) named "property pages".Paper size, orientation, mergins etc. can be set here

WinForms chart zooming X-axis labels temporarily disappear when zooming

I have a chart which looks like this:
When I zoom into a section, the labels disappear:
However, I can get the labels back by scrolling all the way to the right and releasing the mouse:
And then when I scroll back to the left, the labels are all visible:
This behaviour is just super weird am I'm completely dumbfounded as to what would cause this, or even how to debug.
Does anyone have any ideas on what I could try to fix this? I'd like the labels to be shown as in the last image, but when first zooming.
It looks like others have had similar issues, so I'm going to try combining several answers I found online to maybe help fix your issue.
John (DevExpress Support) says:
It appears that the AutoLayout feature leads to this issue. Please set the ChartControl.AutoLayout property to False. This should make axis label elements visible.
https://www.devexpress.com/Support/Center/Question/Details/T328948/x-axis-labels-disappear-in-chartcontrol
Valdemar (DevExpress Support) says:
I suggest that you use the Axis2D.ResolveOverlappingOptions properties. Set AllowHide to False:
[XAML]
<dxc:XYDiagram2D.AxisX>
<dxc:AxisX2D >
<dxc:AxisX2D.Label>
<dxc:AxisLabel>
<dxc:Axis2D.ResolveOverlappingOptions>
<dxc:AxisLabelResolveOverlappingOptions AllowRotate="True" AllowStagger="True" AllowHide="False" />
</dxc:Axis2D.ResolveOverlappingOptions>
</dxc:AxisLabel>
</dxc:AxisX2D.Label>
</dxc:AxisX2D>
</dxc:XYDiagram2D.AxisX>
https://www.devexpress.com/Support/Center/Question/Details/Q489042/chart-axis-labels-disappearing-when-chart-is-resized
SharpStatistics says:
The only way I could replicate the problem you describe is by setting the x axis Label.style interval to a specific value, say,
area1.AxisX.LabelStyle.Interval = 100;
and then when I zoom in on the chart if the zoomed x axis section is less than 100 I don't see any lables.
loi-se (the OP) replies:
Thanks for your suggestion! But as far as i know i don't set the xaxis labelstyle anywhere, i just use: Chartarea1.AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount
This works fine in the case of the yaxis but the xaxis seems to behave on its own will. Maybe i should renew my .net framework installation and get the latest version of the chart component? Any other suggestions?
https://social.msdn.microsoft.com/Forums/vstudio/en-US/d345d4a3-a4be-4b41-9c83-9a9d9dbb69b9/the-labels-of-the-xaxis-are-disappearing-when-i-zoom-in?forum=MSWinWebChart
This one is for SSRS reports, but I'm assuming it uses the same (or similar library) and supports the link right above this one.
When designing an SSRS Report using Chart you may notice that some of the labels whether in X or Y axis are not being displayed, this is because it’s so smart that it detects what you actually want (not!).
To display all labels follow the steps below:
Right click either the X or Y axis, Click Properties:
Set the Interval to 1:
Viola!
https://randypaulo.com/2012/02/20/ssrs-chart-label-missing-xy-axis-missing/
That's about all I can find that are similar, without spending a bunch more time researching this. Hopefully something here helped!

SSRS bar chart issue

I am trying to add one box and one line on x-axis. Please look at below bar chart.
I tried using stripline but I cannot set height for stripline. It goes till 100.
Is there any way I can do this?
Unfortunately, SSRS doesn't provide the functionality you're looking for. A stripline is the closest you can get to that, but like you said, you can't control its height. The only way you could simulate this behavior would be to use a Background Image for your stripline, but that may be more work than it's worth. It would require a lot of manual adjustment to get the image to line up on the chart.
I would add a series to the chart using the Stock chart (under Range). In the Series Properties I would set the High value to the height desired for your line (~52 in your example). Ideally this would come from a dataset value.
Set the Low, Open and Close values to 0.
Try two Stripe Lines. First, create the strip line which represents the vertical value you're after. In my case, I made one that was 50% of the graph height off of the Y-Axis.
Chart Properties:
Height of StripeLine:
Once the stripe line is the correct height for the chart, create a 'mask' stripe line along the X-axis that will cover the portion of the Y-axis line you want hidden.
Chart Propterites:
Width of Stripe Mask:
Using these methods, and some really clever expression writing, you should be able to make the line exactly as high, and as wide as you desire.

Crystal Reports is cutting right text on report and paper

I got this problem that drive me crazy. I have a project in VS2013 with v.13.0.15.1840. I'm using a auto grow field (has his own section) in crystal reports that is displaying a text interpreted as RTF. The problem is that on preview and even paper, the right side of the text is cut off (see screenshot). If the text is justified the it shows OK but I have situations when I need the text align to left.
So far I tried but with no effect:
Setting margins manually on Format Object, Paragraph.
Selecting no printer,Disassociating formatting page size and printer paper size.
Making the field smaller horizontally.
Does anyone know a solution for this?
The field on designer:
Edited for further explanations:
The RTF code can be viewed at https://gist.github.com/andySF/7ca61ffbe6ab6da53ca1
Also another try was to put my field in a textbox and then setting the right margin of the textbox to 3cm. It appears that the margin is somehow overridden after the first paragraph.
Use
Modyfi your datasource text rtf before send in to report CR
model.Document= model.Document.Replace("\pard", "\pard\ri380")

SSRS indicator sizing

When adding an indicator to a report as per the image, is it possible to have all the indicators the same size regardless of the cell size (so centre them all rather than stretching to fill the cell)
Use rectangles within the cells of the table: within these, objects can be easily sized to not take full height or width.
Yes, sizing the rectangles and their contents can be annoying. I don't try to do much of this with the mouse, I quickly fall back to the properties window where I can type position and size.
try clicking on the indicator area (default name ie GaugeReportItem) within GaugePanel. You will get Size and position in Properties on the right hand side where you can choose AutoLayout. This will in effect center and resize gauges based on the cell width, height and your settings.
Hope it helps.
Exporting SSRS report to Excel did not go as expected.
Report with indicators in rectangles exported to Excel was randomly adding 0 height rows between the records which was not what I wanted. My indicators where simple green ticks and red crosses, based on true false. I have tried everything I found out there, even a subreport for indicator. No luck...
Figured it out that the indicators randomly outgrows the parent item when you export it, just like a chart. Ended up with saving a tick and a cross as an image. Then used an image control(with fit proportional set) and embedded Image with conditional statement to pick specific image. Also added some padding not to overlap borders.
The only problem I could think of is if the background of the report is not white as I could not change the background color of the cell the Image is and there is no option for the Image background.
Hope this helps someone else.

Resources