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
Vijay,
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?
-Graham
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 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; }