Hello,
I am using a column chart and I have to load the chart from different stored procedures based on the link clicked by the user and I was wondering if there is a way to display Title Left dynamically i.e. for one chart I want to display say "Month" for one SP and "Year" for another SP. How can I do that?
Thanks
You can do this with the code snippet below:
UltraChart1.TitleLeft.Text = "Whatever!";
You can also change other facets of TitleLeft which determined how it is displayed. You should just throw that code in when you load the chart. Good luck and I hope this helps!
-Paul
Thanks for the reply Paul. but my question is....I am using just one chart, this chart brings back different data from a stored procedure depending on what the user selects from 3 dropdownlists. Now, the chart is being generated dynamically everytime there is a new user selection, similarly, is there a way to display the title left dynamically for each user selection since each selection brings back different data for the chart to display.
Also, to display series labels on x-axis, is there a custom format to display just what is specified as opposed to repeating values.
Sorry, from what I understood you just wanted to change the TitleLeft display when you loaded new data, and the provided code snippet would do just that. Here's a longer example to show what I'm talking about (below). When the chart first loads it displays some information regarding meats, and then when you click on the data the chart loads up some new information regarding vegetables. So the data changes dynamically, and when I set the new data, by data binding, I also make sure to change the TitleLeft.Text property.
private void BarChart_Load(object sender, EventArgs e) { NumericSeries testData = new NumericSeries(); testData.Label = "Meats"; testData.Points.Add(new NumericDataPoint(3.5, "Ham", false)); testData.Points.Add(new NumericDataPoint(19.2, "Turkey", false)); testData.Points.Add(new NumericDataPoint(6.4, "Beef", false)); testData.Points.Add(new NumericDataPoint(11.9, "Chicken", false)); ultraChart1.TitleLeft.Text = "Left Title 1"; ultraChart1.TitleLeft.Visible = true; ultraChart1.Series.Add(testData); ultraChart1.Data.DataBind(); }
private void ultraChart1_ChartDataClicked(object sender, Infragistics.UltraChart.Shared.Events.ChartDataEventArgs e) { NumericSeries testData = new NumericSeries(); testData.Label = "Vegetables"; testData.Points.Add(new NumericDataPoint(33.5, "Lettuce", false)); testData.Points.Add(new NumericDataPoint(29.2, "Tomato", false)); testData.Points.Add(new NumericDataPoint(26.4, "Cabbage", false)); testData.Points.Add(new NumericDataPoint(41.9, "Potato", false)); ultraChart1.TitleLeft.Text = "Left Title 2"; ultraChart1.Series.Clear(); ultraChart1.Series.Add(testData); ultraChart1.Data.DataBind(); }
I'm not 100% sure what you're trying to do, so if you could share some code that'd be great. As of right now I'm not sure why you would no be able to just do something similar to what I've done in the above code.
Regarding your second inquiry about series labels, I'm unsure what label you are referring to, if you could send a picture to detail your problem that would be great.
Thanks for your patience and good luck!