Am I going mad/blind? Probably a combination of the two.
How does one go about removing the data labels from a pie chart with the new chart control in .net 4?
I can get these to display as tooltips absolutely fine, but ultiamtely I'd like the labels not to be present as it looks rather busy.
I've searched previous answers and seen code behind resolutions but surely there must be some sort of code infront option to turn these labels off?
Apologies for being thick/blind.
EstadoPie2.Series("EstadoSummarySeries")("PieLabelStyle") = "Disabled"
This worked for me.
for (var i = 0; i < Chart.Series.Count; i++)
{
Chart.Series[i]["PieLabelStyle"] = "Disabled";
}
Related
I am creating a pie chart with the legend at the bottom. I have added the config to truncate the legend label by passing
chart.legend.labels.template.maxWidth = 120;
chart.legend.labels.template.truncate = true;
Works fine until i try to right align the value by passing
chart.legend.valueLabels.template.align = "right";
After adding this, the labels are not truncated and occupy the full width.
Any help on how to achieve both truncating and also having the values aligned to the right would be much appreciated. Also I could not find any adapter method to overwrite the label. If so, I can strip the label after certain characters and return.
Here is a codepen demo of the above mentioned issue.
It was an issue acknowledged by the amcharts team and it was fixed later.
Using ToolTip I am displaying data point values on a line chart. The ToolTip display was activated with the following code:
Chart1.Series("Wtr").ToolTip = "#VALY"
This works as it should but I need to perform some math on #VALY" before ToolTip displays it. Basically, I need to divide it by a fixed factor to reduce the value to a percentage (e.g. #VALY / fixed factor.) I've tried assigning #VALY to a variable but I can't get the value of #VALY.
I also tried using the ToolTip Popup event but it doesn't fire when hovering over a chart series. ToolTip Keywords might be the solution but I can't find a way to assign a fixed value to a Keyword.
I've spent several weeks researching and playing with this but haven't hit on a solution as yet. Any help would be greatly appreciated.
This is a Windows 7 / VB.Net 2012 platform.
In case anyone else needs to know, i finally solved the problem myself. I created a dataview on my datatable and used it to databind the columns in the datatable. I was then able to select any column I wanted for my tooltip. In this case I wanted to display "WtrRaw" when hovering over a "Wtr" data point.
prdView = New Dataview(dtProd)
ChartProd.Series("Wtr").Points.DataBind(prdView, "X-Axis", "Wtr", ToolTip = "WtrRaw")
I have over 9,00,000 records in my Access database but only a fraction of that is being displayed in the listbox. How Many Rows Can A Listbox Hold? Around 65K is the answer I got from my research.
Thanks!
There is a bug in the native listbox control that was introduced at Vista time and is still present in Win7. It prevents you from scrolling properly past 65536 + number of visible items. The most visible part of the bug, beyond not seeing the later items, is the scrollbar thumb jumping back when you drag it to the bottom.
This bug doesn't get put to the test very often. Nobody ever expects his user to have enough patience to claw through tens of thousands of items. Such a program gets uninstalled quickly. ListBox capacity is otherwise only limited by the amount of available virtual memory. If you really want to pursue this then use ListView or DataGridView.
I'm not sure what the exact limit is (The url provided below gives some suggestions) I think the number of items you want to populate the listbox with will probably slow your computer down alot if it's populating it with that many records.
Maybe you should consider using a different control that allows paging like a DataGrid or something similar to display 100 results at a time?
This link might be useful to you: http://codeguru.earthweb.com/forum/showthread.php?p=1715288
Creating datagrid with paging: http://support.microsoft.com/kb/305271
I've found it preferable to use DataGridView over ListBox in winforms. The key is to use VirtualMode. I'd derive from DataGridView similar to:
class CustomDgv : DataGridView {
public CustomDgv() {
this.BackgroundColor = SystemColors.Window;
this.BorderStyle = BorderStyle.None;
this.Dock = DockStyle.Fill;
this.MultiSelect = false;
this.AutoGenerateColumns = false;
this.RowHeadersVisible = this.AllowUserToResizeRows = false;
this.ReadOnly = true;
this.AllowUserToAddRows = this.AllowUserToDeleteRows = false;
this.CellBorderStyle = DataGridViewCellBorderStyle.None;
this.VirtualMode = true;
this.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
this.RowTemplate.Height = this.FontHeight + this.FontHeight / 2;
}
}
and then implement the virtual part accordingly.
I'm having a lot of problems reordering the items in the legend of my charts. The thing is I like the order in the chart but I think the order in the legend is wrong and I'd like to reverse that order.
What I tried is:
CType(Me.Content, C1Chart).LegendItems = CType(Me.Content, C1Chart).LegendItems.Reverse()
But it looks like the LegendItems property is readOnly :S
Finally I found the solution of this problem. Some hours lost trying to find a good solution to fix what I think it's a bug .... and at the end I found an easy way.
In the chart legend you can include this property: FlowDirection="RightToLeft"
I succeeded to reverse the legend by reversing only one ChartGroup:
C1Chart1.ChartGroups.ChartGroupsCollection(0).LegendReversed = False
C1Chart1.ChartGroups.ChartGroupsCollection(1).LegendReversed = True
I have over 9,00,000 records in my Access database but only a fraction of that is being displayed in the listbox. How Many Rows Can A Listbox Hold? Around 65K is the answer I got from my research.
Thanks!
There is a bug in the native listbox control that was introduced at Vista time and is still present in Win7. It prevents you from scrolling properly past 65536 + number of visible items. The most visible part of the bug, beyond not seeing the later items, is the scrollbar thumb jumping back when you drag it to the bottom.
This bug doesn't get put to the test very often. Nobody ever expects his user to have enough patience to claw through tens of thousands of items. Such a program gets uninstalled quickly. ListBox capacity is otherwise only limited by the amount of available virtual memory. If you really want to pursue this then use ListView or DataGridView.
I'm not sure what the exact limit is (The url provided below gives some suggestions) I think the number of items you want to populate the listbox with will probably slow your computer down alot if it's populating it with that many records.
Maybe you should consider using a different control that allows paging like a DataGrid or something similar to display 100 results at a time?
This link might be useful to you: http://codeguru.earthweb.com/forum/showthread.php?p=1715288
Creating datagrid with paging: http://support.microsoft.com/kb/305271
I've found it preferable to use DataGridView over ListBox in winforms. The key is to use VirtualMode. I'd derive from DataGridView similar to:
class CustomDgv : DataGridView {
public CustomDgv() {
this.BackgroundColor = SystemColors.Window;
this.BorderStyle = BorderStyle.None;
this.Dock = DockStyle.Fill;
this.MultiSelect = false;
this.AutoGenerateColumns = false;
this.RowHeadersVisible = this.AllowUserToResizeRows = false;
this.ReadOnly = true;
this.AllowUserToAddRows = this.AllowUserToDeleteRows = false;
this.CellBorderStyle = DataGridViewCellBorderStyle.None;
this.VirtualMode = true;
this.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
this.RowTemplate.Height = this.FontHeight + this.FontHeight / 2;
}
}
and then implement the virtual part accordingly.