I am creating a web application using c#. I have four values(or series) volt,current,wh and temperature which I will have to plot in a chart control against time which(time) will be shown in x-axis. All things done correctly. But the range of the values are different like one is in range of more than 1000,another lies between 0 to 10,another shows negetive value,etc. I want to create different y-axis for each series.I had created two y-axis which is a property of series(YAxisType),primary and secondary. Is it possible to create multiple y-axis?I had searched in google but didn't get any proper answer. Please help me.
You can only use 2 y-axis(primary and secondary)
But you can create a few chart areas within one chart control
Or you can add a button that will hide one chart control and show another(with others 2 axis)
Related
I have generated a chart in asp.net c#, which gets user data from the database and display it. Now I want to add a line to it which can indicate the baseline set by the user. I think it might be a new series which will be drawn from start to end. It will be ideal if the user is able to change it and on changing the line is redrawn. I have dates on x-axis and activity time on y axis. In the following picture I want line like Goal. Any suggestions?
There are two ways I know which can be used to achieve this line.
One is by adding the tag but the line will appear under the bars.
If you want the line to appear above the bars then you need to add another series of type line chart. Make its x axis secondary and specify the values so that it appears as a straight line. Hide the lengends and labels etc for line chart.
I am drawing a bar chart and I saw some of them have different width than others.
I tried changing PointWidth and PixelPointWidth properties. But of no use. Here is the graph I got :
The only configure I done is barChart1.Series["DeltaE"]["PointWidth"] = (0.6).ToString();
You may have too many data and the chart is too small. Try delete some data or make the chart bigger.
I made an example. I created a c# project, put a chart in the form, randomly add some data and run the program.
When the chart is big enough, it looks well.
When the chart is smaller, not all the columns are the same width.
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 was perusing the asp.net chart control's sample website, and came across something in the pie chart gallery. There was 3 pie charts, "stair stepped" on top of each other. I starting using this control for a financial services application, and would like to replicate this effect. It looks like this:
3d Stair stepped Pie Chart http://www.freeimagehosting.net/uploads/87a5caabca.png
I'd post some code on what I've accomplished so far, but I have no idea where to start with this. I'm guessing maybe I'd have to create the 3 charts, and offset their axes, am I off base here? Any help would be appreciated.
You need to create 3 seperate series and assign them to seperate chart areas.
The chart areas need to stepped down the page using position.x and position.y
Other tricks include disabling the legend for the second and subsequent series.
To get the transparency affect you need to work at a data point level in the series. Note the Ownership data point is not transparent but the renting and leasing data points are.