Hi,
I want to load my chart from existing xml files and also want a rendered chart to be exported to an xml file for later use. How should I go about it?
Thanks a lot.
http://community.infragistics.com/forums/p/46896/253397.aspx#253397
Hi Teodor,
Thanks for the quick reply.
I tried using SavePreset method but it doesnt seem to save the xml file for my chart. The code I am using is:
NumericSeries numSeries = new NumericSeries(); numSeries.Points.Add(new NumericDataPoint(Convert.ToDouble(45), "Pass", false));numSeries.Points.Add(new NumericDataPoint(Convert.ToDouble(75), "Unknown", false));numSeries.Points.Add(new NumericDataPoint(Convert.ToDouble(45), "Fail", false));numSeries.Label = "Y Axis Text";myInfraChart.Series.Add(numSeries);
myInfraChart.SavePreset(@".\ChartImages", "Chart1Settings.xml", "a", Infragistics.WebUI.PresetType.Appearance);
Please let me know what I may be mssing here.
Thanks.
Hello,
I am following up to see if you have any further questions with this matter.
Update me if any further assistance needed.
Thanks,
Bhadresh
In order to save and load layout, I would recommend you to use “SavePreset” method and “LoadPreset”. The following links from our website will give you more details on “SavePreset” and “LoadPreset” method:
<http://help.infragistics.com/NetAdvantage/ASPNET/2010.3/?page=Infragistics4.WebUI.UltraWebChart.v10.3~Infragistics.WebUI.UltraWebChart.UltraChart~SavePreset(TextWriter,String,String,PresetType).html>
<http://help.infragistics.com/NetAdvantage/ASPNET/2010.3/CLR4.0/?page=Infragistics4.WebUI.UltraWebChart.v10.3~Infragistics.WebUI.UltraWebChart.UltraChart~LoadLayout(Object,XmlTextReader).html>
Hope this helps.
Hi Troy,
When I load a Preset for a Bar chart and set its series then my chart and legend shows up correctly. But when I change it to BarChart3D, legend disappears and the chart shows up in only 1 color.
Code:
string fileName = "Office2007BarColumnStyle17_1.xml";StreamReader reader = new StreamReader(this.Page.MapPath("./" + fileName));chart.LoadPreset(reader, true);reader.Close();myInfraChart.ResetBarChart3D();NumericSeries numSeries = new NumericSeries();numSeries.Points.Add(new NumericDataPoint(Convert.ToDouble(10), "a", false));numSeries.Points.Add(new NumericDataPoint(Convert.ToDouble(20), "b", false));numSeries.Points.Add(new NumericDataPoint(Convert.ToDouble(30), "c", false));myInfraChart.Series.Add(numSeries); myInfraChart.ChartType = ChartType.BarChart3D;myInfraChart.ColorModel.ModelStyle = ColorModels.CustomLinear;myInfraChart.ColorModel.CustomPalette = new Color[] { Color.Red, Color.Blue, Color.Green};
I have attached the preset file, and generated Bar Chart for 2D and 3D also. Please let me know what I am missing.
Hi Sandy,
Okay. Great! Please let me know if you have any additional questions regarding this matter.
Finally I could get the serialization to work. Sorry for the confusion.
The code I used is:
System.IO.StreamWriter sw = new System.IO.StreamWriter(this.Page.MapPath("./MyPreset.xml"));this.myInfraChart.SavePreset(sw, "My Preset", "This is a description of my preset", Infragistics.WebUI.PresetType.All);sw.Close();