ASP.NET (C#) Column Chart on top of Column Chart - c#

I am drawing 2 RangeColumn Graphs, problem is they appear next to each other. I am wondering if there is a setting that will allow me to draw the graphs on top of each other. So graph 2 will be visible over graph 1. Both graphs have different widths so I should still be able to see graph 1 in the back.
Here is a google image I found that describes what I want

http://msdn.microsoft.com/en-us/library/dd456710.aspx
You need to set the DrawSideBySide property to false. You can then play with the widths to get your desired effect.

Related

Remove all space between Devexpress ChartControl panes

I'm currently working with a DevExpress ChartControl with several panes stacked vertically on top of each other. The panes can individually be shown or hidden at runtime, but their contents won't change after they're created. I'd like to remove all space between the panes so that the border of each is totally flush with the border of the pane above/below it.
I've already used the following code to set the PaneDistance to 0, which normally would do exactly what I'm looking for:
XYDiagram diagram = chartControl1.Diagram as XYDiagram;
diagram.PaneDistance = 0;
However, the problem I'm running into, visible in the screenshow below, is that the labels on my y axes can sometimes extend vertically above or below the edge of the pane itself, which forces there to be space between my panes.
The first two panes have no space between them at all, which is exactly what I want, but the problem can be seen on the bottom whree panes. The "0" label on the second pane extends slightly below the table, so empty space is added to allow it to fit. The bottom two axes both have labels that extend outside their panes, so even more space is being added.
I've tried editing every property of these axes that I can think of, but nothing has been able to remove this blank space. It seems like just getting the outer labels to be pushed up or down so they're inside the pane height should do the trick. Anyone have any ideas on how I can get this working like it should?
Edit: I'll mention that in a different part of this app, I have a different set of panels, rotated and aligned horizontally, with their axis labels doing what I want them to do in the case above:
You can see that the "0" and "300" labels are shifted slightly off-center to fit within their own pane, so they don't extend out and create empty space. I didn't have to touch any code to get that to happen. It could be because these are all instances of the same axis, while the ones that don't do this are different axes, that causes them to play nice in this case?
Edit 2:
Here's what I've got after setting my axis SideMarginsValues to 0 and AlwaysShowZeroLevel to false. Getting closer!
if you can't achieve what you need with DX chart's public properties there is still one trick you can try.
In Browser choose Inspect the chart area (CTRL+SHIFT+I in Chrome) and find the actual chart's element or the parent element and see what classes/ids DX have assigned to them.
Then pick the nearest element class/id and try to play with it's css by assigning negative margins/paddings like:
.dxtcLite.dxtc-top .dxtc-stripContainer {
margin-botton: -2px!important;
}
This is of course a dirty solution but sometimes it's the only one which works.
However, if you don't have any HTML-type margin/padding between chart panes but the blank space is actually a part of the generated chart Image, then probably the only thing you can do is to continue playing with DX chart properties which affect the actual chart image generation.
UPDATE:
Have you tried setting the Range.SideMarginsValue property to 0?
diagram.AxisY.WholeRange.SideMarginsValue = 0;
Another option would be to try to always hide 0-level axis label using
WholeRange.AlwaysShowZeroLevel :
diagram.AxisY.WholeRange.AlwaysShowZeroLevel = false;
or try setting max values for the axis values to exclude border labels:
// depending on possible min/max values for each pane
diagram.AxisY.WholeRange.SetMinMaxValues(5, 35 );
Let me know if anything of the above helps.

Alignment of text when column width is changed from GUI in winform application

I have developed a winform application. It has a listview with multiple columns having different texts. Initially, I have set the column width = -2 to take the size of longest text in the column.
The issue is that sometime text overshoots the laptop screen and a horizontal scroll bar appeared in the list view.
To fit all the columns in a screen, I manually modified the columns widths using column boundaries in the GUI. When I modify the column width, the column text starts disappearing from right. I want it to disappeared from left.
I have searched goggle a lot but did not find the answer.
Question might look weird or may be I have not explained it properly. Please let me know if more information is needed.
Thanks in advance.
The Listbox columns in Windows Forms are not exactly a high level control, I've used it some times but just for simple lists, It certainly has not a builtin function to make what you want, to obtain it you probably need to subclass the control, create a new class for the item managed in the list and write some code to perform what you need.
I think you can find some hints on how to achieve all this in Charles Petzold book about windows forms where he shows how to measure a string and how to draw directly on your control.

Is there a graph component that lets me specify x- and y-axis to be positioned in an other grid?

I am working on a projekt to display data in form of a graph. In order for me to do what i want to do i need a graph or chart component that lets me move the x- and y-axis to different grids.
To clarify:
My graph should consist of 3 different parts.
1: The actual graph that displays the line.
2: The y-axis.
3: The x-axis.
I want to put the graph (1) in one grid, the y-axis (2) inside an other grid and the x-axis (3) inside a third grid.
I have looked at WPF-Toolkit and Data Driven Documents (D3) but I can not figure out a way to split these 3 parts in the way that I have described here.
Is it possible to use WPF-Toolkit or D3 to achieve this or is there an other component that lets me do this?
The component does not need to be free but I should be able to modify it like this.
You can use the Syncfusion components for WPF, they have a very good Chart component

MS Chart zooming with multiple chart areas

I am having an issue when trying to set up zooming into a chart area. I have made multiple charts before where the user selects an area and it zooms in normally, but in this particular application I have 3 chart areas in one chart control and when I make a selection in one chart area, all of the other chart areas zoom to that area as well.
You can see that all three chart areas are selected when I am only selecting the first one.
The only code I have for each one of these chart areas is
Chart1.ChartAreas[i].CursorX.IsUserSelectionEnabled = True;
Chart1.ChartAreas[i].CursorY.IsUSerSelectionEnabled = True;
Chart1.ChartAreas[i].AxisX.Zoomable = True;
Chart1.ChartAreas[i].AxisY.Zoomable = True;
NOTE: I have this set for each individual chart area, I just didn't want to write too much.
So I was wondering if anybody knows of any possible way to make each individual chart area zoomable with a selection of the mouse and not zoom the other 2 chart areas when I make a selection in one?
Thank you so much for your time and consideration
I found out what the issue was and why all the chart areas were zooming at the same time --
I had Chart.ChartArea[i].AlignWithChartArea set to other charts to make the visuals a bit better. Apparently that binds the zooming as well for some reason.

Chart Controls: Stacked Column Series Label Positioning

I am creating a stacked column graph but am currently limited by the lack of label positioning for each series. There are not any custom properties which relate to alignment of label positioning, is there some other way to offset labels or align them for stacked charts?
By creating a dummy series and manually setting each label value you can reposition a stacked columns labels to either the top or bottom of the stack. It is limited, and certainly not what I would like, but it is the best I have found so far.
While the control used is different the best example of the concept I have found is here:
total value of each column in a stacked column
Check out my blog post for more details and a better method of handling this:
http://jeremeguenther.blogspot.com/2015/02/overlapping-columns-in-microsoft-aspnet.html
last paragraph from the msdn : link
you might wanna check out the SmartLabelStyle altough I've never used it with column chart type. link

Categories

Resources