Infragistics data chart C# WPF highlight part of a series - c#

I have a listview box which contains my data, it is loaded when selected into a infragistics data chart, it is all loaded into a single stacked bar series. What I now need to be able to do is click one segment of the bar series and be able to highlight and zoom in.
Does anyone have any advice?
Thanks in advance.

I suppose you are using Bar/ColumnSeries to display single stacked bars.
To highlight you can make use of ChartAnnotationLayers to highlight a particular value & hence the bar by setting the MarkerTemplate property.
Also you can set a default value or override it on hover.
The documentation here can help.

Related

SciChart dynamic annotations

In the SciChart tutorials there are only instructions how to add a LabelProvider with hardcoded Label texts, that can be switched on different values (https://www.scichart.com/example/wpf-chart-example-stacked-column-side-by-side/). Is there any way to programmaticaly add and handle axis labels?
UPD: Idea is to mark columns with different labels, so that every column has a text label instead of numeric value on the main axis.
Solution is pretty obvious. To dynamically handle labels from ViewModel, you can bind a LabelProvider itself.

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.

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

C# Listview - error provider on listview

can anyone please let me know is it possible to show error provider icon on listview.
ie if Im having a listview of items.. I would like to show error icon on a specific item in a row.
Typically you'd solve this problem by changing the icon to an error (red circle with white cross) and adding a tooltip to the ListViewItem.
if you want to use your images in the listview use ImageList class and bind it to the listview via SetImagelist method.
You can try a freeware WinForms component Better ListView Express. It allows displaying images of arbitrary size in both items and sub-items. You can also draw your own graphics with powerful owner drawing.
For example, all items can be shifted and you can display the ErrorProvider icon next to the items, or after them. Overlay is also possible.

Datagrid scrolling in Windows s Mobile way to get rid of scroll bar?

I have a very simple form using the compact framework. I have two search fields a search button and a datagrid. The button sets the DataSource for a DataGrid on the form. I know that I can set the height and width on the DataGrid but I don't want the user to have to use the scroll bars on the DataGrid as it has a few hundred records. I just want the user to use the scroll bar on the form to scroll. How do I accomplish this?
I am assuming that the behavior you want is for a vertical scroll bar that spans the total height of the form to navigate through the records of the DataGrid. This DataGrid does not take up all the space on the form.
You could add a VScrollBar to the side of the form and set its Maximum to the total row count of your DataGrid. Then attach to the ValueChanged event of the scroll bar and manipulate the selected row of your DataGrid. This in effect would be mimicking the scrolling behavior of the DataGrid.
The tricky part is hiding the scroll bar of the DataGrid, as there is no property to hide it. You can extend its width so that the scroll bar is rendered off screen, but remember to set the Form's AutoScroll property to false so that it does not render a Horizontal scroll bar that would reveal the DataGrid kludge.
Based on your application, you may want to look into using a ListView with the View property set to Details. The ListView is much easier to manipulate in the compact framework and might fit your application better. You can still use the same VScrollBar technique above and apply it to the ListView if you wish.
You must get the rowcount from the DataSource. Cast it like the enclosed example to produce the row count: (rsMissingItems is a SqlCEResultSet object)
Dim intRecCnt As Int32 = DirectCast(rsMissingItems.ResultSetView, ICollection).Count

Categories

Resources