If you're doing this through the designer:Select your column layerGo to the ChartTypeAppearance propertyFind ChartText collectionEdit the collection and add a new item to itSet Column and Row properties to -2Set Visible property to trueor in code:ColumnChartAppearance appearance = new ColumnChartAppearance();ChartTextAppearance chartText = new ChartTextAppearance();chartText.Column = chartText.Row = -2;chartText.ItemFormatString = "<DATA_VALUE:0.##>";chartText.Visible = true;appearance.ChartText.Add(chartText);myLayer.ChartTypeAppearance = appearance;
Perfect!!!
Thanks
Hi,
I am using a Columnline Chart. I want to use ChartText property which is present in the chart. I dont know how many values i will be getting in the graph, but for all the things, i want to add the Charttext property dynamically through the Codebehind file.
If it is possible please send me the sample code.
Regards,
Shilpa Gopalan
Hello Timothy
Could you please take a look at that forum thread http://es.infragistics.com/community/forums/t/77623.aspx There you could find a sample with desired functionality. If you have any questions, please feel free to write us
Regards
Hello,
I'm trying to create a composite chart to dsiplay both a column chart and a line chart similar to the attached image. I'm having trouble formatting the y and y2 axis and getting the the X Axis to format to "MM/dd/yyyy". Also the y Axes aren't extending far enough to show the Y2 data pionts. Heres the code that I have so far:
Dim columnLineChart As New UltraChart
columnLineChart.ChartType =ChartType.Composite
Dim area As New ChartArea()
columnLineChart.CompositeChart.ChartAreas.Add(area)
Dim xAxisColumn As New AxisItem(columnLineChart, AxisNumber.X_Axis)
Dim xAxisLine As New AxisItem(columnLineChart, AxisNumber.X_Axis)
xAxisColumn.DataType =AxisDataType.String
xAxisColumn.SetLabelAxisType = Layers.SetLabelAxisType.GroupBySeries
xAxisColumn.Labels.ItemFormat =AxisItemLabelFormat.ItemLabel
xAxisLine.DataType =AxisDataType.String
xAxisLine.SetLabelAxisType = Layers.SetLabelAxisType.ContinuousData
Dim yAxis As New AxisItem(columnLineChart, AxisNumber.Y_Axis)
yAxis.DataType =AxisDataType.Numeric
yAxis.TickmarkStyle =AxisTickStyle.Smart
yAxis.TickmarkInterval = 10
yAxis.NumericAxisType =NumericAxisType.Linear
yAxis.RangeType =AxisRangeType.Automatic
yAxis.Labels.ItemFormat =AxisItemLabelFormat.DataValue
Dim yAxis2 As New AxisItem(columnLineChart, AxisNumber.Y2_Axis)
yAxis2.DataType =AxisDataType.Numeric
yAxis2.Labels.ItemFormat =AxisItemLabelFormat.DataValue
yAxis2.TickmarkStyle =AxisTickStyle.Percentage
area.Axes.Add(xAxisColumn)
area.Axes.Add(xAxisLine)
area.Axes.Add(yAxis)
area.Axes.Add(yAxis2)
Dim seriesColumn As New NumericSeries()
seriesColumn.Data.DataSource = table
seriesColumn.Data.LabelColumn ="WeekEnd"
seriesColumn.Data.ValueColumn ="Evaluations"
Dim seriesLine As New NumericSeries()
seriesLine.Data.DataSource = table
seriesLine.Data.LabelColumn ="WeekEnd"
seriesLine.Data.ValueColumn ="Score"
columnLineChart.Series.AddRange({seriesLine, seriesColumn})
Dim columnLayer As New ChartLayerAppearance()
columnLayer.AxisX = xAxisColumn
columnLayer.AxisY = yAxis
columnLayer.ChartArea = area
columnLayer.ChartType =ChartType.ColumnChart
columnLayer.Series.Add(seriesColumn)
Dim LineLayer As New ChartLayerAppearance()
LineLayer.AxisX = xAxisLine
LineLayer.AxisY = yAxis2
LineLayer.ChartArea = area
LineLayer.ChartType =ChartType.LineChart
LineLayer.Series.Add(seriesLine)
columnLineChart.CompositeChart.ChartLayers.Add(columnLayer)
columnLineChart.CompositeChart.ChartLayers.Add(LineLayer)
columnLineChart.Border.Color =Color.LightGray
columnLineChart.Width = 1000
columnLineChart.Height = 500
columnLineChart.Axis.Y.TickmarkStyle =
AxisTickStyle.Smart
columnLineChart.Axis.Y.TickmarkInterval = 10
columnLineChart.Axis.Y.NumericAxisType =NumericAxisType.Linear
columnLineChart.Axis.Y.RangeType =
AxisRangeType.Automatic
columnLineChart.Axis.Y2.TickmarkStyle =AxisTickStyle.Percentage
ChartTextAppearance chartText = new ChartTextAppearance();chartText.Column = chartText.Row = -2;chartText.ItemFormatString = "<DATA_VALUE:0.##>";chartText.Visible = true;chart.ColumnLineChart.Column.ChartText.Add(chartText);chart.ColumnLineChart.Line.ChartText.Add(chartText);