Jump to content
Software FX Community

mr.mghenry

Members
  • Posts

    10
  • Joined

  • Last visited

mr.mghenry's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Actually what might be happening is this. Series 1: Max value = 250 starts in Jan, 2008 and data decreases each month after. Series 2: Max value = 217 starts in Mar, 2008 and data decreases each month after. If these two series are stacked it seems to be only scaling to the max value. So at the Mar time point is reading off the chart as the max value on the chart is only 250. The reason is that I set the AxisY.Max = 60000; Later I make a call to chart.RecalculateScale() and it renders the max value back to 250. Thanks again, Mike
  2. I have a chart that is adding series automatically from code. When the second series that I'm adding has a higher value (y-axis) than the first but starts at a later point in time on the x-axis, the graph (stacked bar) only scales to the first series. I've tried autoscaling the axisy also tried using the chart.Recalculatescale after the seriesattributes have been added to the chart but still not working. Any thoughts? Mike Henry
  3. Just wondering if anyone has responded to this or if you have solved this problem yourself?
  4. The reason for this is that my object that I'm graphing is: public class EngineeringChartDtoCrossTab { private string source; private double value; private DateTime accountDate; public EngineeringChartDtoCrossTab(string source, double value, DateTime accountDate) { this.source = source; this.value = value; this.accountDate = accountDate; } public string Source { get { return source; } } public double Value { get { return value; } } public DateTime AccountDate { get { return accountDate; } } } I want to have the "Source" create the series, "AccountDate" be the x-axis labels and "Value" be the data point. However for all series that a crosstabtransform would create I want all the series except one of them to be a bar graph that is stacked...and one where the graph produces a line that is not stacked and also a line not a bar. Thanks for your help, Mike
  5. Hello, When I create a chart using CrossTabTransform, how do I get to a particular series that the CrossTabTransform created to change it's gallery type? Thanks, Mike
  6. Juan C, Thanks for you reply...however yesterday I made some changes to the way that I was filling the chart and it now looks like this I changed from the CrosstabTransorm to a ListTransform . Everything works fine except that for every DateTime property I'm getting 4 values (based on the AccountTypeName from my object model) and they are not stacked (I think), only because the x-axis is not being populated with the DateTime values. Here is what my new code looks like: chart.Series.Clear(); chart.DataTransforms.Clear(); chart.ItemsSource = null; chart.Titles.Clear(); chart.Culture = CultureInfo.CurrentCulture; chart.AxisY.Title.Content = "Boed"; var dataTransform = new ListTransform(); dataTransform.SeriesPath = "Source"; dataTransform.ValuePath = "Value"; dataTransform.XValuePath = "DateTime"; dataTransform.ColumnPath = "AccountDetails"; dataTransform.Sorted = true; dataTransform.RowPath = "DateTime"; chart.DataTransforms.Add(dataTransform); chart.DataBound += chart_DataBound; chart.AxisX.Labels.Format = AxisFormat.Date; chart.AxisX.Separation = 0; chart.AxisX.AutoScale = true; chart.AxisX.Title.Content = "Month"; chart.Gallery = Gallery.Bar; chart.AllSeries.Stacked = true; chart.AllSeries.StackedStyle = StackedStyle.Normal; chart.ItemsSource = items; chart.Titles.Add(new Title("Volumes (boed)")); I also changed my object of items to the following: public class EngineeringChartDto { private string source; private IRichList<EngineeringAccountDetail> accountDetails; public EngineeringChartDto(string year, IRichList<EngineeringAccountDetail> accountDetails) { this.source = year; this.accountDetails = accountDetails; } public EngineeringChartDto(string year) : this(year, new RichList<EngineeringAccountDetail>()) { } public string Source { get { return source; } } public IRichList<EngineeringAccountDetail> AccountDetails { get { return accountDetails; } } } public class EngineeringAccountDetail { private readonly DateTime dateTime; private readonly string accountTypeName; private readonly double value; public EngineeringAccountDetail(DateTime dateTime, string accountTypeName, double value) { this.dateTime = dateTime; this.accountTypeName = accountTypeName; this.value = value; } public string DateTime { get { return dateTime.ToString(OracleDate.DayMonthYearFormat); } } public string AccountTypeName { get { return accountTypeName; } } public double Value { get { return value; } } }
  7. Hey, I was wondering if you could help me with this? I'm getting the "Index outside the bounds of the array" Here is the code to create my chart: chart.Series.Clear(); chart.DataTransforms.Clear(); chart.ItemsSource = null; chart.Titles.Clear(); chart.Culture = CultureInfo.CurrentCulture; chart.AxisY.Title.Content = "Boed"; var dataTransform = new CrosstabTransform(); dataTransform.ValuePath = "Volume"; dataTransform.RowPath = "AccountDateString"; dataTransform.ColumnPath = "Series"; dataTransform.Sorted = true; chart.DataTransforms.Add(dataTransform); chart.DataBound += chart_DataBound; chart.AxisX.Labels.BindingPath = "AccountDateString"; chart.AxisX.Labels.Format = AxisFormat.Date; chart.AxisX.Separation = 0; chart.AxisX.AutoScale = true; chart.AxisX.Title.Content = "Month"; chart.Gallery = Gallery.Bar; chart.AllSeries.Stacked = true; chart.AllSeries.StackedStyle = StackedStyle.Normal; chart.ItemsSource = items; chart.Titles.Add(new Title("Volumes (boed)")); and here is the object that is in the items list public class EngineeringChartDto { private string budgetEntity; private string commodityType; private DateTime accountDate; private double volume; private string series; public string Series { get { return series; } } public EngineeringChartDto(string budgetEntity, string commodityType, DateTime accountDate, double volume, string series) { this.budgetEntity = budgetEntity; this.series = series; this.commodityType = commodityType; this.accountDate = accountDate; this.volume = volume; } public string BudgetEntity { get { return budgetEntity; } } public string CommodityType { get { return commodityType; } } public DateTime AccountDate { get { return accountDate;} } public string AccountDateString { get { return accountDate.ToString(OracleDate.DayMonthYearFormat); } } public double Volume { get { return volume; } } public override string ToString() { return accountDate.ToShortDateString(); } } } Here is the Error: at as.c(Int32 A_0) at ChartFX.WPF.Internal.PlotAreaCore.a(PaintMark A_0, AttributesResolver A_1, Double A_2, Double A_3, LogicalItemCollection A_4, LogicalItemCollection A_5, Int32 A_6) at ChartFX.WPF.Internal.PlotAreaCore.a(AttributesResolver A_0, Double A_1, Double A_2) at ChartFX.WPF.Internal.PlotAreaCore.e(Double A_0, Double A_1) at ChartFX.WPF.Internal.PlotAreaCore.a(Double A_0, Double A_1, Boolean A_2) at ChartFX.WPF.Internal.PlotAreaItems.OnRenderSizeChanged(SizeChangedInfo sizeInfo) at System.Windows.ContextLayoutManager.fireSizeChangedEvents() at System.Windows.ContextLayoutManager.UpdateLayout() at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.MessageBox(HandleRef hWnd, String text, String caption, Int32 type) at System.Windows.MessageBox.ShowCore(IntPtr owner, String messageBoxText, String caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, MessageBoxOptions options) at System.Windows.MessageBox.Show(String messageBoxText, String caption) at longrangemodel.ui.Main.ErrorMessageBox(String message) in C:\Projects\longrangemodel\src\app\longrangemodel.ui\Main.xaml.cs:line 128 at longrangemodel.ui.Main.Dispatcher_UnhandledException(Object sender, DispatcherUnhandledExceptionEventArgs e) in C:\Projects\longrangemodel\src\app\longrangemodel.ui\Main.xaml.cs:line 123 at System.Windows.Threading.Dispatcher.CatchException(Exception e) at System.Windows.Threading.Dispatcher.CatchExceptionStatic(Object source, Exception e) at System.Windows.Threading.ExceptionWrapper.CatchException(Object source, Exception e, Delegate catchHandler) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run() at longrangemodel.ui.App.Main() in C:\Projects\longrangemodel\src\app\longrangemodel.ui\obj\Debug\App.g.cs:line 0 Any help would be greatly appreciated, Thanks, Mike Henry
  8. Also did I mention that my list has 2000 items. Thanks Mike
  9. I'm having a similiar problem. I have a list (IList<EngineeringChartDto>) of objects (1215 of them) that I"m adding to the chart.ItemSource property. If I sort this list by AccountDate before I set the ItemSource on the chart I get the Index outside the bounds of the array error message. If I don't sort this list, it puts the items in unordered, meaning that a date time value of 1/1/2008 will show up on the right side of 6/6/2012 but does show the chart, but again, values are out of order. I'm using the following code to set and transform the items and create the chart below.. chart.Series.Clear(); chart.DataTransforms.Clear(); chart.ItemsSource = null; chart.Titles.Clear(); chart.AxisY.Title.Content = "Volumes"; CrosstabTransform dataTransform = new CrosstabTransform(); dataTransform.ValuePath = "Volume"; dataTransform.RowPath = "AccountDate"; dataTransform.ColumnPath = "ForecastYear"; chart.DataTransforms.Add(dataTransform); chart.AxisX.Labels.BindingPath = "AccountDate"; chart.AxisX.AutoScale = true; chart.Gallery = Gallery.Bar; chart.AllSeries.Stacked = true; chart.AllSeries.StackedStyle = StackedStyle.Normal; chart.ItemsSource = items; chart.Titles.Add(new Title("Project Volumes"));public class EngineeringChartDto { private string budgetEntity; private string commodityType; private DateTime accountDate; private double volume; private int forecastYear; public int ForecastYear { get { return forecastYear; } } public EngineeringChartDto(string budgetEntity, string commodityType, DateTime accountDate, double volume, int forecastYear) { this.budgetEntity = budgetEntity; this.forecastYear = forecastYear; this.commodityType = commodityType; this.accountDate = accountDate; this.volume = volume; } public string BudgetEntity { get { return budgetEntity; } } public string CommodityType { get { return commodityType; } } public DateTime AccountDate { get { return accountDate; } } public double Volume { get { return volume; } } } Can you help me...thanks Mike.
×
×
  • Create New...