Hi,
I amtrying to show 1000 labels in the X-Axis.The labels are of type datetime.I would like to see the chart labels either in weekly,monthly or yearly.Is there any way to achieve this ?Please let me know
Thanks,
Vijay
Your only control handles on the labeling for the xamWebChart are to set the minimum, maximum and unit of the range. So I don't think it would be possible, currently, to implement what you are trying for. I would recommend making a feature request for this functionality.
http://devcenter.infragistics.com/protected/requestfeature.aspx
-Graham
Did this question ever go any further? I have the same issue. I would like to draw a line (or scatterline) graph going back anywhere from 1 to 10 years with Daily data. However, depending on the period I would like to draw intelligent gridlines and labels on the first day of each week, month or year (similar to how Yahoo Finance, google and most financial sites work). Is there any way to do this in WebChart?
Vijay,
Could you further explain what you mean by "labels for the 4 months once"? It may help the discussion if we have a reference. How does what you want differ from this simple example that plots 1000 data points on the time axis in a scatter line chart:
<UserControl x:Class="SilverlightApplication14.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
xmlns:igChart="clr-namespace:Infragistics.Silverlight.Chart;assembly=Infragistics.Silverlight.DataVisualization.Chart.v9.2">
<Grid x:Name="LayoutRoot">
<igChart:XamWebChart x:Name="theChart" >
<igChart:XamWebChart.Series>
<igChart:Series ChartType="ScatterLine" DataSource="{Binding}" DataMapping="ValueX = Date; ValueY = Value" />
</igChart:XamWebChart.Series>
</igChart:XamWebChart>
</Grid>
</UserControl>
Code Behind:
public partial class MainPage : UserControl
{
public MainPage()
InitializeComponent();
DateTime date = DateTime.Now.AddDays(-1000);
Random rand = new Random();
ObservableCollection<TestDataItemViewModel> testData =
new ObservableCollection<TestDataItemViewModel>();
double last = 3.0;
for (int i = 0; i < 1000; i++)
double value = rand.NextDouble() * 2.0;
double sign = rand.NextDouble();
if (sign > .5)
value = value * -1.0;
}
last += value;
TestDataItemViewModel testItem = new TestDataItemViewModel()
Date = date,
Value = last
};
testData.Add(testItem);
date = date.AddDays(1);
DataContext = testData;
public class TestDataItemViewModel
public DateTime Date { get; set; }
public double Value { get; set; }
I would like to show 1000 datapoints in the chart.
For example :
I would like to see the data for 3 years in the chart.The StartDate might be today and EndDate might be 1000 days back from today.The Data would be present for each day.In this case ,i need not see all the dates in the X-Axis ,instead i would like to see labels only for the 4 months once and all the values in Y-Axis .Hope it clarifies. Let me know if you need further clarifications.
Please let me know how to achieve this ?
Could you clarify what you are trying to accomplish here? You want to be able to display 1000 months on the x-axis, or 1000 years, or 1000 weeks, with a label for each year/month,week? What is your goal?