Here's a piece of code that generates an UltraChart (taken from a sample in the documentation) and then serializes it using the persistence framework:
public UltraChart GetChart() {
UltraChart lChart = new UltraChart();
lChart.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.Composite;
ChartArea myChartArea = new ChartArea();
lChart.CompositeChart.ChartAreas.Add(myChartArea);
AxisItem axisX = new AxisItem();
axisX.OrientationType = AxisNumber.X_Axis;
axisX.DataType = AxisDataType.String;
axisX.SetLabelAxisType = SetLabelAxisType.GroupBySeries;
axisX.Labels.ItemFormatString = "<ITEM_LABEL>";
axisX.Labels.Orientation = TextOrientation.VerticalLeftFacing;
AxisItem axisY = new AxisItem();
axisY.OrientationType = AxisNumber.Y_Axis;
axisY.DataType = AxisDataType.Numeric;
axisY.Labels.ItemFormatString = "<DATA_VALUE:0.#>";
myChartArea.Axes.Add(axisX);
myChartArea.Axes.Add(axisY);
NumericSeries seriesA = GetNumericSeriesBound();
NumericSeries seriesB = GetNumericSeriesUnBound();
lChart.CompositeChart.Series.Add(seriesA);
lChart.CompositeChart.Series.Add(seriesB);
ChartLayerAppearance myColumnLayer = new ChartLayerAppearance();
myColumnLayer.ChartType = ChartType.ColumnChart;
myColumnLayer.ChartArea = myChartArea;
myColumnLayer.AxisX = axisX;
myColumnLayer.AxisY = axisY;
myColumnLayer.Series.Add(seriesA);
myColumnLayer.Series.Add(seriesB);
lChart.CompositeChart.ChartLayers.Add(myColumnLayer);
CompositeLegend myLegend = new CompositeLegend();
myLegend.ChartLayers.Add(myColumnLayer);
myLegend.Bounds = new Rectangle(0, 75, 20, 25);
myLegend.BoundsMeasureType = MeasureType.Percentage;
myLegend.PE.ElementType = PaintElementType.Gradient;
myLegend.PE.FillGradientStyle = GradientStyle.ForwardDiagonal;
myLegend.PE.Fill = Color.CornflowerBlue;
myLegend.PE.FillStopColor = Color.Transparent;
myLegend.Border.CornerRadius = 10;
myLegend.Border.Thickness = 0;
lChart.CompositeChart.Legends.Add(myLegend);
return lChart;
}
public Stream GetChartStream()
{
var lChart = GetChart();
PersistenceManager lManager = PersistenceManager.GetInstance();
PersistenceData lData = new PersistenceData();
lData.Controls.Add(lManager.SaveControl(lChart, "control"));
return lData.ToStream();
And it is generating this error:
"The XML element 'EnableTheming' from namespace '' is already present in the current scope. Use XML attributes to specify another XML name or namespace for the element."
at line "return lData.ToStream();"
Why could this be?
Thanks in advance.
Hello rickycl,
I am looking into this matter of any error using the UltraChart with the persistence framework. I will give you a progress update by the end of the day Wednesday.
Sincerely,Mike P.Developer Support EngineerInfragistics, Inc.www.infragistics.com
Hello rickcl,
I have done some research into this matter and I have a question to help clarify the issue. What are you trying to persist with the WebChat? From my understanding it doesn’t seem as though persisting is relevant because the WebChat is an image that is generated.
Sincerely,
Mike P.
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com