Hi,
I've added a WebChart which is bound to a datatable populated from an SQL stored procedure. The datatable has one column that is a DateTime and a second that is a Double. However using the chart definition below I do not get the X axis labels formated as 'dd-MM-YYYY'. Any ideas which attribute is worng?
I'm sett ing the X axis labels ItemFormat="Custom" ItemFormatString="<DATA_VALUE:dd-MM-yyyy>" ?
Thanks
Paul
<igchart:UltraChart ID="HistoryChart" runat="server" Width="100%" BackgroundImageFileName="" BorderColor="Black" BorderWidth="1px" ChartType="ScatterLineChart" EmptyChartText="No data available for graph." Version="8.3"> <TitleTop Font="Tahoma, 12pt"> </TitleTop> <Tooltips Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" /> <Data SwapRowsAndColumns="True"> </Data> <ColorModel AlphaLevel="150" ColorBegin="MediumBlue" ColorEnd="DarkRed" ModelStyle="Office2007Style" Scaling="Decreasing"></ColorModel> <Axis> <PE ElementType="None" Fill="Cornsilk" /> <X LineThickness="1" TickmarkInterval="10" 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" ItemFormat="Custom" ItemFormatString="<DATA_VALUE:dd-MM-yyyy>" Orientation="VerticalLeftFacing" VerticalAlign="Center"> <SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" FormatString="" HorizontalAlign="Near" Orientation="VerticalLeftFacing" VerticalAlign="Center"> <Layout Behavior="Auto"> </Layout> </SeriesLabels> <Layout Behavior="Auto"> </Layout> </Labels> </X> <Y LineThickness="1" TickmarkInterval="20" 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="Far" ItemFormatString="<DATA_VALUE:00.##>" Orientation="Horizontal" VerticalAlign="Center"> <SeriesLabels Font="Verdana, 7pt" FontColor="DimGray" FormatString="" HorizontalAlign="Far" Orientation="Horizontal" VerticalAlign="Center"> <Layout Behavior="Auto"> </Layout> </SeriesLabels> <Layout Behavior="Auto"> </Layout> </Labels> </Y> </Axis> </igchart:UltraChart>
I am not sure about the format, but one way to solve this problem would be to add the points with the desired format. Something like this:
Chart.Points.Add(new NumericDataPoint(value, DateTime.Today.ToString("dd-MM-yyyy"), false)
or if you are doing direct databinding then change your source data to desired format.
I'll try that, but I would assume that the WebChart should be able to databind directly to one DateTime column (as X), and one Double column (as Y), and create a scatter diagram. I check the data format returned in the data table and they are correctly reported as 'System.DateTime' and 'System.Double.
Unless this is something special about the ScatterLine chart as my date axis is not equally spaced points.
CheersPaul