Hi,
I need to implement a stacked column chart. I have done simple stacked column chart using webchart control.But now the one which I need to implement is not what I do in daily basis. So if anyone can guide me by providing a documentation or steps to do it. It will be also helpful if anyone can tell me the chart type.
I have attached the screen shot of the chart which I have to build.
Thanks,Sanjay
Check out this thread, there is a sample attached in there.
http://ko.infragistics.com/community/forums/p/67117/340695.aspx#340695
Hi DmgInc
How can I have Y-axis values in millions?
Hello Sanjay,
You can set Custom range type of the Y axis and set RangeMax and RangeMin Property based on your requirement as shown below:
UltraChart1.Axis.Y.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom;
UltraChart1.Axis.Y.LogBase = 10;
// set whether the axis is linear or a logarithmic scale
UltraChart1.Axis.Y.NumericAxisType = Infragistics.UltraChart.Shared.Styles.NumericAxisType.Linear;
// sets the maximum value displayed on the axis
UltraChart1.Axis.Y.RangeMax = 100000;
// set the minimum value displayed on the axis
UltraChart1.Axis.Y.RangeMin = 0;
Refer to the link below that will give more details on this:
<http://help.infragistics.com/NetAdvantage/ASPNET/2012.1/CLR4.0/?page=Infragistics4.WebUI.UltraWebChart.v12.1~Infragistics.WebUI.UltraWebChart.UltraChart~Axis.html>
I hope this helps.
Hi Bhadresh,
I have attached image here. If you notice the Y axis you will see the numbers. These numbers are in millions but it displays as if its in thousands. 0, 500, 1000, 1500 and so on.I want to achieve this. I'm not sure How I can achieve this.
Also if you see on the image we have vertical text saying in Millions(US$) how will I do that?
Thanks for helping me out.
Sanjay
I can help you with the text.
ultraChart1.TitleLeft.Text = "In Millions (US$)"; ultraChart1.TitleLeft.Orientation = TextOrientation.VerticalLeftFacing; ultraChart1.TitleLeft.HorizontalAlign = StringAlignment.Center; ultraChart1.TitleLeft.Visible = true;
Lucas
Also if you want your numbers to be in the thousands, can't you just take your data that is in the millions and do the division yourself? So take all your #s and just divide them by 1000 before you place them in the chart.
Yes, the solution provided above shows you how to customize label using IRenderLabel and tooltip will show you correct number. The code will be something like below:
this.UltraChart1.Axis.Y.Labels.ItemFormatString = "<MY_VALUE>"; Hashtable MyLabelHashTable = new Hashtable(); MyLabelHashTable.Add("MY_VALUE", new MyLabelRenderer()); this.UltraChart1.LabelHash = MyLabelHashTable;
public class MyLabelRenderer : IRenderLabel { public string ToString(Hashtable context) { double dataValue = (double)context["DATA_VALUE"]; if (dataValue >0) { return (dataValue / 1000).ToString(); } return dataValue.ToString() + " [Negative]"; } }
You can change the return value based on your requirement.
See this thread : http://ko.infragistics.com/community/forums/p/51901/271378.aspx#271378
You will need to change the links to the DOCs though, just replace "2010.3" to "2012.1" in any of the help links and they will load.
Thanks for your response regarding the text.
As far as the data concern when you hover over the bars the tool tip should display data in millions only so if I divide them by any number then the tool tip will display divided data not actaul one.