Does anyone have an example of how I can replace the data in the series (which in inputted manually from the chart wizard) with the data from the datasouce? I set up the data source and it works but I don't know what the appropiate control markup is to populate the chart with the data from the database...any help would be appreciated.
<%@ Register Assembly="Infragistics35.WebUI.UltraWebChart.v8.2, Version=8.2.20082.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.UltraChart.Data" TagPrefix="igchartdata" %>
<head id="Head1" runat="server">
<body>
<form id="form1" runat="server">
<div>
<igchart:UltraChart ID="UltraChart1" runat="server" BackgroundImageFileName="" BorderColor="Black"
BorderWidth="1px" ChartType="Composite" EmptyChartText="Data Not Available. Please call UltraChart.Data.DataBind() after setting valid Data.DataSource"
Version="8.2" Width="571px" DataSourceID="commpaper">
<CompositeChart>
<Series>
<igchartprop:NumericDataPoint Value="72088000" Label="09/03/2008">
</igchartprop:NumericDataPoint>
<PE ElementType="None"></PE>
<igchartprop:NumericDataPoint Value="91217000" Label="09/05/2008">
<igchartprop:NumericDataPoint Value="117245000" Label="09/09/2008">
<igchartprop:NumericDataPoint Value="42652000" Label="09/12/2008">
<igchartprop:NumericDataPoint Value="42881000" Label="09/17/2008">
<igchartprop:NumericDataPoint Value="63321000" Label="09/19/2008">
<igchartprop:NumericDataPoint Value="61100000" Label="09/25/2008">
<igchartprop:NumericDataPoint Value="111230000" Label="10/06/2008">
<igchartprop:NumericDataPoint Value="26877000" Label="10/10/2008">
<igchartprop:NumericDataPoint Value="35213000" Label="10/27/2008">
</igchartprop:numericseries>
<igchartprop:NumericDataPoint Value="2.205391" Label="09/03/2008">
<igchartprop:NumericDataPoint Value="2.211008667" Label="09/05/2008">
<igchartprop:NumericDataPoint Value="2.218386667" Label="09/09/2008">
<igchartprop:NumericDataPoint Value="2.184895" Label="09/12/2008">
<igchartprop:NumericDataPoint Value="2.205932" Label="09/17/2008">
<igchartprop:NumericDataPoint Value="2.195744" Label="09/19/2008">
<igchartprop:NumericDataPoint Value="2.2060665" Label="09/25/2008">
<igchartprop:NumericDataPoint Value="2.2230665" Label="10/06/2008">
<igchartprop:NumericDataPoint Value="2.186735" Label="10/10/2008">
<igchartprop:NumericDataPoint Value="2.258894" Label="10/27/2008">
</Series>
<ChartLayers>
<igchartprop:chartlayerappearance axisxkey="axis1" axisykey="axis2" chartareakey="area1"
<igchartprop:ColumnChartAppearance></igchartprop:ColumnChartAppearance>
</igchartprop:chartlayerappearance>
<igchartprop:chartlayerappearance axisxkey="axis4" axisykey="axis3" chartareakey="area1"
<igchartprop:LineChartAppearance Thickness="2" StartStyle="SquareAnchor" HighLightLines="True"></igchartprop:LineChartAppearance>
</ChartLayers>
<ChartAreas>
<igchartprop:AxisItem Key="axis1" OrientationType="X_Axis" DataType="String" SetLabelAxisType="GroupBySeries" TickmarkInterval="0">
<MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel="255"></MinorGridLines>
<SeriesLabels HorizontalAlign="Center" VerticalAlign="Center" Orientation="Horizontal"></SeriesLabels>
</igchartprop:AxisItem>
<MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel="255"></MajorGridLines>
<Labels ItemFormatString="<DATA_VALUE:00.##>" HorizontalAlign="Near" VerticalAlign="Center" Orientation="Horizontal">
</Labels>
<igchartprop:AxisItem Key="axis3" OrientationType="Y2_Axis" DataType="Numeric" SetLabelAxisType="GroupBySeries" TickmarkStyle="Smart" TickmarkInterval="0.02">
<Labels ItemFormatString="" HorizontalAlign="Near" VerticalAlign="Center" Orientation="Horizontal">
</Axes>
</igchartprop:chartarea>
</ChartAreas>
</CompositeChart>
<ColorModel AlphaLevel="150" ColorBegin="Pink" ColorEnd="DarkRed" ModelStyle="CustomLinear">
</ColorModel>
<Effects>
<igchartprop:gradienteffect></igchartprop:gradienteffect>
</Effects>
<Axis>
<PE ElementType="None" Fill="Cornsilk" />
<X LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart" Visible="True">
<MajorGridLines AlphaLevel="255" Color="Gainsboro" DrawStyle="Dot" Thickness="1"
Visible="True" />
<MinorGridLines AlphaLevel="255" Color="LightGray" DrawStyle="Dot" Thickness="1"
Visible="False" />
<Labels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Near" ItemFormatString="<ITEM_LABEL>"
Orientation="VerticalLeftFacing" VerticalAlign="Center">
<SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" FormatString="" HorizontalAlign="Near"
<Layout Behavior="Auto">
</Layout>
</SeriesLabels>
</X>
<Y LineThickness="1" TickmarkInterval="0.1" TickmarkStyle="Smart" Visible="True">
<Labels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Far" ItemFormatString="<DATA_VALUE:00.##>"
Orientation="Horizontal" VerticalAlign="Center">
<SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" FormatString="" HorizontalAlign="Far"
</Y>
<Y2 LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart" Visible="False">
<Labels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Near" ItemFormatString="<DATA_VALUE:00.##>"
<SeriesLabels Font="Verdana, 7pt" FontColor="Gray" FormatString="" HorizontalAlign="Near"
</Y2>
<X2 LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart" Visible="False">
<Labels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Far" ItemFormatString="<ITEM_LABEL>"
<SeriesLabels Font="Verdana, 7pt" FontColor="Gray" FormatString="" HorizontalAlign="Far"
</X2>
<Z LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart" Visible="False">
<Labels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Near" ItemFormatString=""
<SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" HorizontalAlign="Near" Orientation="Horizontal"
VerticalAlign="Center">
</Z>
<Z2 LineThickness="1" TickmarkInterval="0" TickmarkStyle="Smart" Visible="False">
<Labels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Near" ItemFormatString=""
<SeriesLabels Font="Verdana, 7pt" FontColor="Gray" HorizontalAlign="Near" Orientation="Horizontal"
</Z2>
</Axis>
</igchart:UltraChart>
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT PAR_AMT, YIELD FROM "COMMPAPER""></asp:SqlDataSource>
</div>
</body>
</html>
The Series DataSources must be set in code; there is no design-time support for these properties right now.
I have a table with a string, a number, and another number to populate the composite graph. what's the code to bind the results from that query to my existing composite graph? thanks.
NumericSeries mySeries = new NumericSeries();
mySeries.Data.DataSource = myTable;
mySeries.Data.ValuesColumn = "ValuesA";
mySeries.Data.LabelsColumn = "Label";
NumericSeries mySeries2 = new NumericSeries();
mySeries2.Data.DataSource = myTable;
mySeries.Data.ValuesColumn = "ValuesB";
That usually means that there's no data coming from the datatable, you may not have binded it correctly. Ignore the "you need at least one numeric column" -- if there's no data since then there is no numeric column, so that's where that comes from..
I finally got mine to work a couple of days ago, here the code, I hope this helps:
Private Shared Function GetNumericSeriesPar(ByVal dt_in As DataTable) As NumericSeries
series.Label = "Maturity Date"
' this code populates the series from an external data source
series.Data.DataSource = dt_in
series.Data.LabelColumn = "Label Column"
series.Data.ValueColumn = "Value Column"
End Function
Dim series As New NumericSeries()
series.Label = "Series Yield"
End Sub
'Dim upload_id As String
'upload_id = Request.QueryString("asofdate")
'upload_id = "10/07/2008"
Dim command As OracleCommand
' Dim ds As DataSet
Try
If Not IsPostBack Then
Dim connString As String
connString = sr.ReadLine()
connection.Open()
.Connection = connection
.CommandType = CommandType.StoredProcedure
.CommandText = "P_COMMPAPER.CPR_GET_DATA_MAIN"
'.Parameters.Add(New OracleParameter("upload_id_in", OracleType.VarChar)).Direction = ParameterDirection.Input
.Parameters.Add(New OracleParameter("data_cursor_p", OracleType.Cursor)).Direction = ParameterDirection.Output
'.Parameters("upload_id_in").Value = upload_id
End With
adapter.Fill(ds)
Repeater1.DataSource = ds.Tables(0)
Repeater1.DataBind()
Dim myChartArea As New ChartArea()
axis1.OrientationType = AxisNumber.X_Axis
axis1.DataType = AxisDataType.String
axis1.SetLabelAxisType = SetLabelAxisType.GroupBySeries
'axis1.Visible = False
axis1.Labels.ItemFormatString = "<ITEM_LABEL>"
axis1.Labels.Orientation = TextOrientation.VerticalRightFacing
axis1.Labels.HorizontalAlign = Drawing.StringAlignment.Center
axis1.Labels.VerticalAlign = Drawing.StringAlignment.Center
'axis1.Extent = 80
axis1.TickmarkStyle = AxisTickStyle.DataInterval
axis1.TickmarkInterval = "1"
'axis1.TickmarkStyle = AxisTickStyle.Smart
'axis1.TickmarkInterval = "0"
myChartArea.Axes.Add(axis1)
axis2.OrientationType = AxisNumber.Y_Axis
axis2.DataType = AxisDataType.Numeric
axis2.SetLabelAxisType = SetLabelAxisType.GroupBySeries
axis2.Labels.ItemFormatString = "<DATA_VALUE:$0,000,000>"
axis2.Labels.HorizontalAlign = Drawing.StringAlignment.Near
axis2.Labels.VerticalAlign = Drawing.StringAlignment.Center
axis2.TickmarkStyle = AxisTickStyle.Smart
axis2.LineThickness = 1
axis2.LineColor = Drawing.Color.Black
'axis2.Extent = 120
'axis2.TickmarkInterval = "20000000"
myChartArea.Axes.Add(axis2)
axis3.OrientationType = AxisNumber.X_Axis
axis3.DataType = AxisDataType.String
axis3.SetLabelAxisType = SetLabelAxisType.ContinuousData
axis3.Visible = False
axis3.Labels.HorizontalAlign = Drawing.StringAlignment.Near
axis3.Labels.VerticalAlign = Drawing.StringAlignment.Center
axis3.Labels.Orientation = TextOrientation.VerticalRightFacing
axis3.LineColor = Drawing.Color.Black
axis3.LineThickness = 1
axis3.TickmarkInterval = "1"
axis3.Labels.ItemFormatString = "<ITEM_LABEL>"
'axis3.Labels.Orientation = TextOrientation.VerticalLeftFacing
'axis3.TickmarkInterval = "0"
myChartArea.Axes.Add(axis3)
axis4.OrientationType = AxisNumber.Y2_Axis
axis4.DataType = AxisDataType.Numeric
axis4.SetLabelAxisType = SetLabelAxisType.GroupBySeries
axis4.Labels.ItemFormatString = "<DATA_VALUE:0.##>"
axis4.Labels.HorizontalAlign = Drawing.StringAlignment.Near
axis4.Labels.VerticalAlign = Drawing.StringAlignment.Center
axis4.Labels.Orientation = TextOrientation.Horizontal
axis4.LineColor = Drawing.Color.Black
axis4.LineThickness = 1
axis4.TickmarkStyle = AxisTickStyle.DataInterval
axis4.TickmarkInterval = ".0343"
myChartArea.Axes.Add(axis4)
Dim seriesYield As NumericSeries = GetNumericSeriesYield(ds.Tables(2))
Me.UltraChart1.CompositeChart.Series.Add(seriesYield)
'Me.UltraChart2.CompositeChart.Series.Add(seriesPar)
'Me.UltraChart2.CompositeChart.Series.Add(seriesYield)
myColumnLayer.ChartType = ChartType.ColumnChart
myColumnLayer.ChartArea = myChartArea
myColumnLayer.AxisX = axis1
myColumnLayer.AxisY = axis2
myColumnLayer.Series.Add(seriesPar)
myLineLayer.ChartType = ChartType.LineChart
myLineLayer.AxisX = axis3
myLineLayer.AxisY = axis4
myLineLayer.ChartArea = myChartArea
myLineLayer.Series.Add(seriesYield)
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
'Me.UltraChart1.CompositeChart.Legends.Add(myLegend)
' Me.UltraChart1.Axis.Y.MajorGridLines.Visible = False
' Me.UltraChart1.Axis.Y.MinorGridLines.Visible = False
' Me.UltraChart1.Axis.X.MajorGridLines.Visible = False
' Me.UltraChart1.Axis.X.MinorGridLines.Visible = False
Me.UltraChart1.CompositeChart.ChartLayers.Add(myColumnLayer)
ds = Nothing
connection.Close()
End If
Finally
adapter = Nothing
command = Nothing
connection = Nothing
End Try
End Class
there are a couple potential causes to this problem, so some sample code or sample data might help. one suggestion- make sure the columns in your DataTable have their DataType property set to some numeric type.
What does the following mean:
Line Chart Error: You must have at least one row and one numeric column
I am just setting my datasource to my table and binding. Do I need to do more? This is ultrawebchart product btw