okay so I have this task to make a chart, that would start the data horizontally.
Meaning 90degrees to the right(always). same as this in the picture below.
is this even possible? I accomplish the above picture using:
Chart1.ChartAreas["ChartArea1"].Area3DStyle.Rotation = 90;
but the problem is it only works for two data. Other than the 2 data, the pie rotates to its desired behaviour. Like in this image below. which produces 5 data in the chart.
UPDATE
In simple terms I would like to achieve this.
Lucky me! i found the answer with my curiosity.
For the sake of those who are also facing this problem. So the easy answer I was looking for was
Chart1.ChartAreas["ChartArea1"].Area3DStyle.Rotation = -90;
NOTE:
Rotation accept values up until 180 range only.
Because i had this exception error when i tried to put a 270 value.
Exception of type 'System.ArgumentOutOfRangeException' occurred in
System.Web.DataVisualization.dll, but did not handle in the user code
Additional Information: angle of rotation must be specified in the
range of -180 to 180 degrees.
I found another solution here if your chart is not using 3D styles:
c.Series["s1"]["PieStartAngle"] = "270"
The property you are looking for is actually available. On Form.cs (design window) right click on the chart and click properties.
then go to Series->Custom Properties->PieStartAngle.
It's default 0 and it looks like 90. When you change it to 270 your problem will solve.
Btw, you can't write it like
chart1.Series[0].CustomProperties.PieStartAngle = 270;
You only can edit from the design window.
Related
This is example for plot with errorbars. But can it be edited so top and values are different? Normally it is for example 20 +- 5, but I want different top and bottom value, so it will be for example 20 + 2, -7.
In case someone still doesn't understand the question, I will provide an example image below.
EDIT: This is now supported natively in ScottPlot 4.1.32: https://scottplot.net/cookbook/4.1/category/plottable-error-bar/#error-bar-quickstart
The old answer is below.
This used to be supported in ScottPlot, but it looks like it was removed in 4.1. Depending on your usecase it may be worth downgrading to 4.0.49, keeping in mind that you will have less features, worse performance, and no updates or support.
You can work around this on 4.1 by using two scatter plots. You draw one scatterplot which is your data. Then you draw another, with markers invisible and symmetrical error bars. You can adjust the y-value of the invisible markers to simulate asymmetrical error bars.
For example, in your example with 20 +2, -7 you would follow these steps:
Plot a marker at y=20
Plot an invisible marker at y=17.5 with visible errorbars of ± 4.5
Is it possible to adjust Visiblox's labels container? I have encounter a problem with render ranges of axis. Image:
As You can see there is a problem with width of each label (there is 75, and then 10 (one zero has gone)), and my code for ranges is:
<charts:LinearAxis.Range>
<charts:DoubleRange Minimum="-150" Maximum="150"/>
</charts:LinearAxis.Range>
But! If I changed it ranges to -1500,1500 i get this:
And in this case, label for value 750 display as 75.
Have I change style or tamplate to solve this?
I have solved it after playing around with properties of main window, and... simply can't do:
UseLayoutRounding="True"
After setting it on False, I got this:
I hope, that this will be useful for someone :)
PS.: That "bug" was in WPF (I have forgot to write about it)
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;
Is it possible to force the display of grid lines on the chart with the dates for the extreme data points?
I've tried almost every configuration of following Chart DateTimeAxis properties: IntervalType, Interval, Minimum and Maximum but I wasn't satisfied with the result.
Setting properties Minimum and Maximum didn't solve the problem.
For instance (IntervalType="Days" , Interval="4" , Minimum="1/1/2010" , Maximum="1/31/2010"):
If I'm lucky I will generate some random data where only one extreme point will have the date with grid line.
Does somebody have an idea how to solve the problem mentioned above?
Edited to add
I added a bounty to this question since I really need a fast solution for this issue.
I am binding a series of specific pairs to my chart and I'd like to display excactly those given DateTime values on the x-axis.
Since these are usually dates like 6/30/11, 6/30/12 and so on, I can't use the Interval/IntervalType properties because adding 1 year or 365 days to 6/30/11 doesn't necessarily result in 6/30/12.
So what I need to do is either disable the "automatic axis label generation" of the DateTime axis or use another axis type.
LinearAxis doesn't work because it expects double values and CategoryAxis is not an option because it displays the axis labels between two tickmarks instead of underneath them.
I am very grateful for any help!
To be perfectly clear, here is what axis labels I need (taken from another chart component):
This is what I get so far with the Silverlight 4 Toolkit:
€: I also opened a thread in the official Silverlight Toolkit Support Forums.
The vertical lines are set where you specify an interval.
There is no vertical line for the data for 1/31/2010 as it does not fall on an interval.
I'm currently using a semi-transparent WPF form with no border as a camera style device in a program of mine. However, when I access the position (top, left) and dimension (height, width) properties of the form, it would appear they are wrong.
The top property reported to be roughly 26 pixels higher than it actually is in relation to the desktop. IE if I put the forms top and left at (0,0) the properties will report (0, -26).
The height is also incorrect, reporting about 50-60 pixels shorter than it actually is.
Has anybody experienced this problem in the past and have a solution?
Regards,
Andy Hunt
if I understand correctly, this is no problem at all but the expected behavior.
WPF uses DPI-independent virtual units for measuring size and position, not actual pixels.
There are many sources like this explaining this.
If I understood the question wrong (its late and I am tired ;) could you provide a code sample illustrating the issue?
Andrej