vs2010 chart. How to group Y axis value - c#

I have a bar chart. My X-axis are Names and my Y axis are age values. The default bar chart is set to intervals but I want a range (a yes and no chart). I want to make a Y axis displaying something like "under 13", "13-21","+21" and graphing it correctly. How do I do that? I been researching this for a while.
I just need to learn how to do this. But my real project is similar.

Related

Can we draw Tertiary Y Axis with the use of chart control

I want to draw a graph which has 2 different Y axis with one X Axis. Can we take different Y axis for different series? In first series I want candlestick graph and in second column chart, both charts should be in same chart area and should not be mixed with each other.
For example you can see the picture below
A ChartArea can have two x-axes and two y-axes.
The secondary axes are called
chartArea.AxisX2
and
chartArea.AxisY2
Enable them like this:
chartArea.AxisY2.Enabled = AxisEnabled.True;
Now you can style them as usual..
You can relate a Series to one of the Axes by setting the AxisType like this:
yourSeries.YAxisType = AxisType.Secondary;
Talking about axes: It is worth knowing that you can move them relative to each other by setting their Crossing; see here for an example..

Asp.Net ReportViewer Line Chart background

I pass a dataset to my report, which renders a line chart showing a sprint burn down chart. One of the fiends in the dataset is 'PeriodType', which can be either 'Planning, 'Burning' or 'Retrospective'.
The chart shows dates along x axis, and the y axis holds hours.
What I would like to do, is grey the background, where the x axis has a value that is not a 'Burning' period. So the object that is used to create the chart, as mentioned, has a type field I can use.
Is there a way to change the background colour of the x 'columns' based on the flag? Some sort of conditional background colouring? I have searched, but can't seem to find such a handy thing.
Yes, that is possible.
Open the Properties pane, in the BackgroundColor or Color (whichever is relevant) property of the chart, enter an IFF statement like:
=IIF(Str(Fields!PeriodType.Value) <> "Burning", "Gray", "SomeOtherColor")
Hope that helps

Show gridline in chart

I have a c# chart control that shows dates along the horizontal (x) axis. I want to show gridlines only on thosex axis points that represent the start of the month. How may I do this.
I guess you mean mscharts so it could be
chartArea.AxisX.MinorGrid.Enabled = false;
The ones corresponding to the datapoints is the MajorGrid which can also be toggled similarly.
you can also do the same for the Y axis too.

Microsoft Chart Controls: Label multiple y values and variable y axis?

I am currently using Microsoft Chart Controls to generate a box plot chart. I have enabled the IsValueShownAsLabel property of the chart's series, but only the first y-value(lower whisker) value is being labeled. Is there a way to enable the labeling of all y-values in the chart?
Also, is there a way to get a different axis for each data point? The different data points of the chart are not related when it comes to value ranges, so many data points with small y-values are difficult to read on the chart. I have currently enabled scrolling as a workaround, but am not satisfied with the result. I would instead like to have a different y-axis for each data point, so that the y-values for each data point take up the full height of the chart, with the min and max whisker values serving as the y-axis minimum and maximum points. Is this possible?
To get different axis you will need to look into the properties under ScaleBreakStyle under AxisY
Set something like
Chart1.ChartAreas[0].AxisY.ScaleBreakStyle.Enabled = true;
Chart1.ChartAreas[0].AxisY.ScaleBreakStyle.BreakLineStyle = Charting.BreakLineStyle.Wave;
// set this to an even lower value if required
Chart1.ChartAreas[0].AxisY.ScaleBreakStyle.CollapsibleSpaceThreshold = 15;
Not sure on how to get multiple values but can you try setting those values specifically to the labels in these format #VALY1,#VALY2 depending on the number of Y values available.

How to write custom Y-Axis titles on Charting control (Winforms .NET 3.5)

I use the Microsoft Chart Controls for Microsoft .NET 3.5 to plot X/Y data. The Y-axis shows positive values for apples and negative values for oranges. The X-axis shows the time.
I want to place axis titles to the Y-axis. The apples title must be above the Y zero value, the oranges title must be below the Y zero value. The charting control can be re-sized, so I must update the position of the title appropriately.
1) How do place more than one axis title?
2) How do I control the location of the axis title(s) so that they are in the above zero ore below zero range respectively?
The control does not support the requested feature. Only one title can be assigne to each axis.

Categories

Resources