Hi, thanks in advance for looking into this :)
In my datatable which is the source of my chart, I have few columns that are not included, then I have a datetime column called "Date" then I have one column "Energy" whose data i want to show in the Y_axis representing the energy value of each datetime value of my "Date" column.
How do I tell the charting system what the date column name is so the system puts the right datetimes in my X_Axis.
Because for now, the system puts some dates in my x_axis that are not included in my "Date" column values of my datatable . My date column values go from april 2011 to end april 2011, but i get the x_axix ranging from october 2011 till end october 2011.
My linechart is defined in markup with axis x like this:
<
X Visible="True" TickmarkInterval="0" Extent="61" LineThickness="1" TickmarkStyle
="Smart">
<MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel
="255">
</MajorGridLines
>
<MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel
</MinorGridLines
<Labels ItemFormatString="<ITEM_LABEL>" HorizontalAlign="Near" VerticalAlign
="Center"
Orientation="VerticalLeftFacing" Font="Verdana, 7pt" FontColor
="DimGray">
<SeriesLabels HorizontalAlign="Near" VerticalAlign="Center" Orientation
="VerticalLeftFacing"
Font="Verdana, 7pt" FontColor="DimGray" FormatString
="">
<Layout Behavior
="Auto">
</Layout
</SeriesLabels
....
</Labels
and in my code behind i have this:
where constants.usercolname represents the energy column:
protected
e)
{
try
target = 0.0;
;
)axisY.Map(target);
)axisX.MapMinimum;
)axisX.MapMaximum;
(xEnd, targetYCoord));
targetLine.PE.Stroke =
.Gray;
targetLine.PE.StrokeWidth = 1;
e.SceneGraph.Add(targetLine);
}
ex)
, ex.StackTrace);
private void ConfigureChart(ref Infragistics.WebUI.UltraWebChart.UltraChart chart, DataTable dt, bool besoinReelGraph)
chart.Axis.X.Labels.ItemFormatString =
"<DATETIME_VALUE>";
chart.Axis.X.RangeMin = Provider.StartDateDefault.Date.AddMinutes(1).Ticks;
chart.Axis.X.RangeMax = Provider.EndDateDefault.Ticks;
Hashtable t = new Hashtable();
chart.LabelHash = t;
LineAppearance App1 = new LineAppearance();
chart.LineChart.LineAppearances.Add(App1);
chart.Data.ZeroAligned =
false;
chart.Data.IncludeColumn(
"id", false);
"Date", false);
Constants.BESOINREELCOLNAME, false);
Constants.MINPREVCOLNAME, false);
Constants.HOURPREVCOLNAME, false);
Constants.USEDCOLNAME, true);
"FRCTTIME", false);
// columns labels
chart.Data.SetColumnLabels(
new string[] { "Besoin prévue" });
// colors
chart.ColorModel.CustomPalette =
new Color[] { Color.Blue };
chart.LineChart.LineAppearances[0].LineStyle.DrawStyle = Infragistics.UltraChart.Shared.Styles.
LineDrawStyle.Solid;
chart.LineChart.LineAppearances[0].Thickness = 1;
Hi,
Can you try if this helps?
this.UltraChart1.Data.SwapRowsAndColumns = true;