There doesn't seem to be any method in EPPlus for changing the orientation of tick labels on a chart.
I can see it's possible to make changes by using the XML properties exposed by ChartXML but documentation for this seems to be thin on the ground. Can anybody help me out here, please?
Thanks
John
Newer version of Epplus (from 5 onwards I think) support this - you can use Axis.TextBody.Rotation and set it between -90 and 90.
chart.XAxis.TextBody.Rotation = -90;
Related
Am using Devexpress Winforms 12.2 version. I designed XtraReport with Logo on right side. When image is small automatically it align to left. I need to set pull right. Their is no option to set alignment in property. How to write programmatically code in BeforePrint event of xrPictureBox ?
I tried this one but didn't work xrPictureBox1.Image = ContentAlignment.MiddleRight; showing error cannot implicitly convert type ContentAlignment to Drawing.Image
Thanks in Advance.
You'd better search their support channel, there are several threads on this subject, like XTraReport - XRPictureBox alignment and XRPictureBox - Provide the capability to specify image alignment. From the last one looks like they finally provided out of the box solution XRPictureBox.ImageAlignment Property, but you need to upgrade to v15.1. If you can't, check if some of the suggested workarounds in the links work for you.
I made a prototype of a module in PowerPoint 2010. The module drew some lines and shape on a PowerPoint Chart. I used PowerPoint.Point (the Data Point of a series). According to the MSDN article, Point Interface has the a Point.Left, Point.Top, Point.Height and Point.Width property. I used these properties to calculate the corner points of the each Point.
This worked fine in PowerPoint 2010.
But now due to some change in requirements I have to develop this in PowerPoint 2007 SP3. Microsoft updated the PowerPoint 2007 object model with the release of SP3 and introduced some new objects and interfaces, such as Chart, Series, Point etc. But the Point interface does not have Point.Left, Point.Top, Point.Height and Point.Width property.
I am really stuck at the moment. Is there a way I can get these properties by some other object or some other way? Can I use some other version of Office Interop Assembly dll?
You can get Top value from
powerpoint.DataLable.Top
After moving it to top with orientation property. You can do the same for the height by placing the orientation to bottom and then getting the top value. You can get the left value from
powerpoint.DataLable.Left
after moving its orientation to left. You can then calculate the right value from moving the orientation
It isn't trivial to make a demo sample from scratch to try. But have you tried to use
Point.Select()
and then get Left, Top, Width and Height of the selection (object returned by the call or ActiveWindow.Selection.ShapeRange http://msdn.microsoft.com/en-us/library/bb251483(v=office.12).aspx)?
First of all, I've looked at EVERY other post here, about this (I think) and none of them solves it.
I have a graph in excel, where I would like to change the colour of the line. It seems like, everything in the series line settings, is out of reach. If I cannot set the colour, I would like to set the fill to none, so the line is invisible, only showing the markers, which I can manipulate.
However, fill is also in the colour settings.
I have tried recording a macro aswell, but it shows nothing, other than series select.
Other posts here, suggest setting border on the series, but there is no border object to my knowledge.
Does anyone have any tricks that might solve this?
So, over on the MSDN forums, Andrei Smolin managed to solve it for me.
It was indeed Series.Border that fixed it.
The big problem was, that Border does not show up, as an object on series. Not even in VBA.
It seems to be fixed in Excel 2010, but this is the behaviour i'm experiencing in 2007 SP3.
So, the solution was to simply type:
MSExcel.Series Series1 = (MSExcel.Series)Chart.SeriesCollection(1);
Series1.Border.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.FromArgb(79, 129, 189));
which compiled fine, and worked at runtime.
For reference sake, this is the MSDN thread:
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/2816660e-a18e-47f4-b121-02a71cb2c262
In addition to Nicolai's answer, there is an easier way to pass color value to Border.Color, for example:
Series1.Border.Color = (int) XlRgbColor.rgbRed;
For Excel 2007, the following:
series5.Interior.Color = Color.FromArgb(80, 208, 146).ToArgb();
works for me.
Hi I am using Ms chart control in winforms application for displaying values according to dates
I need to change the x-axis label values(Dates) direction horizantal to vertical
I have searched so many properties but i did not find any solution for this.
Any one help me on this problem
Many Thanks ....
As I understand your question - you are asking how to rotate the chart label to display vertically.
You can rotate the x-axis label as follows:
chart1.ChartAreas[0].AxisX.LabelStyle.Angle = -90;
This assumes you have associated your series with the first chart area, which is the default without modification when using the Winforms designer.
The following images shows how the chart would look before the code above is applied, the second image shows how it appears after the code is applied.
Let me know if this is not what you are trying to do and I will post an updated answer.
Before rotation
After Rotation
Edit: Another answer added after my initial post mentions in certain situations it may be important to set chartArea1.AxisX.IsLabelAutoFit = false;
If you have not already done so, get the chart samples from microsoft:
http://archive.msdn.microsoft.com/mschart
Then check the section on Labels
Chart Features > Labels
To answer your question directly, set the angle in LabelStyle, and don't forget to disable autofit
chartArea1.AxisX.IsLabelAutoFit = false;
chartArea1.AxisX.LabelStyle.Angle = 90;
I am currently developing an application in C# using the NPlot Charting Library.
I want to have a 2 bar charts side by side for each label across the X axis instead of them being stacked on top of each other.
Is this possible with Nplot, I couldn't find anything on Google but the Nplot documentation implies that you can have them side by side instead of stacked.
Thanks for any help you can provide.
Found out you change the bases offset i.e.
HistogramPlot myPlot = new HistogramPlot();
myplot.baseOffSet = 0.3f