Jump to content
Software FX Community

Coder

Members
  • Posts

    11
  • Joined

  • Last visited

Coder's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I have version 8.0.3629.29517. If the Y axis has AutoMargin set and the chart is zoomed, the AutoMargin isn't applied. This is especially a problem when data point labels are displayed. When Zoom is turned off, the AutoMargin is applied again.
  2. I have version 8.0.3629.29517. When I try to zoom a chart with Zoom.Style set to Map and my chart contains an Annotation I get an exception. Here is an example. Double-click the chart to enter zoom selection mode. With this object defined...private class DateValue{ public DateTime Date { get; set; } public double Value { get; set; } public DateValue(DateTime date, double value) { Date = date; Value = value; }}This recreates the problem...Chart chart1 = new Chart();chart1.Width = 1024.0;chart1.Height = 768.0;chart1.LegendBox.Visibility = Visibility.Collapsed;Random rnd = new Random(123);List<DateValue> list1 = new List<DateValue>();for (int i = 0; i < 100; i++){ list1.Add(new DateValue(DateTime.Today.AddYears(-2).AddDays(i * 7), (double)rnd.Next(0, 200)));}Axis axisX = new Axis();Axis axisY = new Axis();axisX.DataFormat.Format = AxisFormat.Date;axisX.Labels.HorizontalAlignment = HorizontalAlignment.Right;axisX.Labels.Position = AxisLabelPosition.Center;axisX.Labels.Format = AxisFormat.Date;axisX.Min = DateTime.Today.AddYears(-2);axisX.Max = DateTime.Today;axisX.FontSize = 14;axisX.Title.Content = "Test";axisX.Title.FontSize = 14.0;axisY.Min = 0.0;axisY.Max = 200.0;axisY.AxisStyle = AxisStyles.ShowEnds | AxisStyles.AutoFirstLabel;axisY.Labels.Decimals = 1;chart1.AxesX.Clear();chart1.AxesY.Clear();chart1.AxesX.Add(axisX);chart1.AxesY.Add(axisY);SeriesAttributes sa = new SeriesAttributes();sa.Gallery = chart1.Gallery = Gallery.Line;sa.ItemsSource = list1;sa.BindingPath = "Value";sa.BindingPathX = "Date";sa.Content = "Test";sa.AxisX = axisX;sa.AxisY = axisY;chart1.Series.Add(sa);chart1.MouseDoubleClick += delegate{ chart1.Zoom.Style = ZoomStyle.Map; chart1.Zoom.Mode = ZoomMode.Selection;};Annotations anno = new Annotations();TextBlock tb = new TextBlock();tb.Text = "Test";tb.HorizontalAlignment = HorizontalAlignment.Left;tb.VerticalAlignment = VerticalAlignment.Bottom;tb.FontSize = 20.0;Annotations.SetAttachX(tb, axisX.Min);Annotations.SetAttachY(tb, axisY.Min);Annotations.SetAxisX(tb, axisX);Annotations.SetAxisY(tb, axisY);anno.Children.Add(tb);chart1.Extensions.Add(anno);
  3. I have version 8.0.3629.29517. I have noticed that sometimes when I zoom my bar chart the stripe scroller doesn't work. It seems to be based soley on the number of data items in my data set. Here is an example where 'Chart1', when zoomed with 122 data items, doesn't work. 'Chart2' is identical to 'Chart1' except 200 data items are in the series. When 'Chart2' is zoomed, it works fine. Double-click of the chart starts the zoom selection. With this object defined... private class LabelValue{ public string Label { get; set; } public double Value { get; set; } public LabelValue(string label, double value) { Label = label; Value = value; }} This sets up the charts in a TabControl... TabControl tc = new TabControl();TabItem tab1 = new TabItem();TabItem tab2 = new TabItem();Chart chart1 = new Chart();Chart chart2 = new Chart(); tab1.Header = "Chart 1";tab2.Header = "Chart 2";chart1.Width = 1024.0;chart1.Height = 768.0;chart1.LegendBox.Visibility = Visibility.Collapsed;chart2.Width = 1024.0;chart2.Height = 768.0;chart2.LegendBox.Visibility = Visibility.Collapsed;Random rnd = new Random(123);List<LabelValue> list1 = new List<LabelValue>();List<LabelValue> list2 = new List<LabelValue>();for (int i = 0; i < 122; i++){ list1.Add(new LabelValue(i.ToString(), (double)rnd.Next(0, 200)));}for (int i = 0; i < 200; i++){ list2.Add(new LabelValue(i.ToString(), (double)rnd.Next(0, 200)));}Axis axisX = new Axis();Axis axisY = new Axis();axisX.AxisStyle |= AxisStyles.Categorical;axisX.Labels.HorizontalAlignment = HorizontalAlignment.Right;axisX.Labels.Position = AxisLabelPosition.Center;axisX.Labels.BindingPath = "Label";axisX.FontSize = 14;axisX.Title.Content = "Test";axisX.Title.FontSize = 14.0;axisY.Min = 0.0;axisY.Max = 200.0;axisY.AxisStyle = AxisStyles.ShowEnds | AxisStyles.AutoFirstLabel;axisY.Labels.Decimals = 1;chart1.AxesX.Clear();chart1.AxesY.Clear();chart1.AxesX.Add(axisX);chart1.AxesY.Add(axisY);SeriesAttributes sa = new SeriesAttributes();sa.Gallery = chart1.Gallery = Gallery.Bar;sa.ItemsSource = list1;sa.BindingPath = "Value";sa.Content = "Test";sa.AxisX = axisX;sa.AxisY = axisY;sa.PointLabels.HorizontalAlignment = HorizontalAlignment.Center;sa.PointLabels.VerticalAlignment = VerticalAlignment.Top;sa.PointLabels.Visibility = Visibility.Visible;chart1.Series.Add(sa);chart1.MouseDoubleClick += delegate { chart1.Zoom.Mode = ZoomMode.Selection; };axisX = new Axis();axisY = new Axis();axisX.AxisStyle |= AxisStyles.Categorical;axisX.Labels.HorizontalAlignment = HorizontalAlignment.Right;axisX.Labels.Position = AxisLabelPosition.Center;axisX.Labels.BindingPath = "Label";axisX.FontSize = 14;axisX.Title.Content = "Test";axisX.Title.FontSize = 14.0;axisY.Min = 0.0;axisY.Max = 200.0;axisY.AxisStyle = AxisStyles.ShowEnds | AxisStyles.AutoFirstLabel;axisY.Labels.Decimals = 1;chart2.AxesX.Clear();chart2.AxesY.Clear();chart2.AxesX.Add(axisX);chart2.AxesY.Add(axisY);sa = new SeriesAttributes();sa.Gallery = chart2.Gallery = Gallery.Bar;sa.ItemsSource = list2;sa.BindingPath = "Value";sa.Content = "Test";sa.AxisX = axisX;sa.AxisY = axisY;sa.PointLabels.HorizontalAlignment = HorizontalAlignment.Center;sa.PointLabels.VerticalAlignment = VerticalAlignment.Top;sa.PointLabels.Visibility = Visibility.Visible;chart2.Series.Add(sa);chart2.MouseDoubleClick += delegate { chart2.Zoom.Mode = ZoomMode.Selection; };tab1.Content = chart1;tab2.Content = chart2;tc.Items.Add(tab1);tc.Items.Add(tab2);
  4. I have version 8.0.3629.29517. When I try to set the StrokeThickness for my series and... 1) the LegendBox is displayed and2) the marker visibility is Hidden or Collapsed, it ignores my setting. If I make the markers visible, but set the opacity to 0.0, then the legend doesn't display the line marker or color. If I set the marker size to 0.0, then the legend displays the lines would-be colored marker UNLESS there is another series on the same chart which displays its marker normally. Then the legend doesn't display the line marker or color again. Your help fixing this is greatly appreciated! Here is an example where the two charts are identical except for the LegendBox visibility. The StrokeThickness setting is ignored on the second chart. DataPoint[] dummyData = { new DataPoint(new DateTime(2009, 1, 1), 50.0), new DataPoint(new DateTime(2009, 2, 1), 150.0), new DataPoint(new DateTime(2009, 3, 1), 100.0), new DataPoint(new DateTime(2009, 4, 1), 25.0), new DataPoint(new DateTime(2009, 5, 1), 75.0), new DataPoint(new DateTime(2009, 6, 1), 50.0), };TabControl tc = new TabControl();TabItem tab1 = new TabItem();TabItem tab2 = new TabItem();Chart chart1 = new Chart();Chart chart2 = new Chart();tab1.Header = "Chart 1";tab2.Header = "Chart 2";chart1.AxesX.Clear();chart1.AxesY.Clear();chart2.AxesX.Clear();chart2.AxesY.Clear();chart1.LegendBox.Visibility = Visibility.Collapsed;Axis axisX = new Axis();Axis axisY = new Axis();axisX.DataFormat.Format = AxisFormat.Date;axisX.Labels.Format = AxisFormat.Date;axisX.Min = new DateTime(2008, 12, 1);axisX.Max = new DateTime(2009, 7, 1);axisY.Min = 0.0;axisY.Max = 200.0;axisY.AxisStyle = AxisStyles.ShowEnds | AxisStyles.AutoFirstLabel;chart1.AxesX.Add(axisX);chart1.AxesY.Add(axisY);SeriesAttributes sa = new SeriesAttributes();sa.Gallery = Gallery.Line;sa.StrokeThickness = 10.0;sa.Marker.Visibility = Visibility.Hidden;sa.ItemsSource = dummyData;sa.BindingPath = "Value";sa.BindingPathX = "Date";sa.AxisX = axisX;sa.AxisY = axisY;chart1.Series.Add(sa);axisX = new Axis();axisY = new Axis();axisX.DataFormat.Format = AxisFormat.Date;axisX.Labels.Format = AxisFormat.Date;axisX.Min = new DateTime(2008, 12, 1);axisX.Max = new DateTime(2009, 7, 1);axisY.Min = 0.0;axisY.Max = 200.0;axisY.AxisStyle = AxisStyles.ShowEnds | AxisStyles.AutoFirstLabel;chart2.AxesX.Add(axisX);chart2.AxesY.Add(axisY);sa = new SeriesAttributes();sa.Gallery = Gallery.Line;sa.StrokeThickness = 10.0;sa.Marker.Visibility = Visibility.Hidden;sa.ItemsSource = dummyData;sa.BindingPath = "Value";sa.BindingPathX = "Date";sa.AxisX = axisX;sa.AxisY = axisY;chart2.Series.Add(sa);tab1.Content = chart1;tab2.Content = chart2;tc.Items.Add(tab1);tc.Items.Add(tab2);
  5. My charts are telling me that my license has expired. I have been developing with the beta for 3 months now. We won't be ready to distribute our app until the Fall, so I am not ready for a Go-Live license yet. How do I get a new or updated beta license?
  6. This bug relates to chartfx.wpf.dll version 8.0.3314.22631 If I have a chart with a single pane, the pane title does not display. If I have multiple panes, then all the pane titles appear correctly. My code sample... double [] dummyData = { 10, 20, 30, 40, 50, 60, 70, 80 };Chart chart = new Chart();chart.AxesX.Clear();chart.AxesY.Clear();Pane pane = new Pane();Axis axisX = new Axis();Axis axisY = new Axis();chart.AxesX.Add(axisX);chart.AxesY.Add(axisY);SeriesAttributes sa = new SeriesAttributes();sa.Gallery = Gallery.Line;sa.ItemsSource = dummyData;sa.AxisX = axisX;sa.AxisY = axisY;pane.Title.Content = "Test Title 1";pane.Series.Add(sa);chart.Series.Add(sa);chart.Panes.Add(pane);/*pane = new Pane();axisX = new Axis();axisY = new Axis();chart.AxesX.Add(axisX);chart.AxesY.Add(axisY);sa = new SeriesAttributes();sa.Gallery = Gallery.Line;sa.ItemsSource = dummyData;sa.AxisX = axisX;sa.AxisY = axisY;pane.Title.Content = "Test Title 2";pane.Series.Add(sa);chart.Series.Add(sa);chart.Panes.Add(pane);*/
  7. I am creating a simple chart and passing in data that has ~25 years of data. This is a time series, so the chart is setup for an X-Values date scale. If I show all of the data on the chart, it works fine. However, if I limit the x-range to show less than the whole data set, I get this error, "Exception of type 'System.OutOfMemoryException' was thrown." It works fine to do this with a line chart. I can work around this by using a subset of my data that's within my x-axis min/max range, but I thought I would bring it to your attention. My code example... Chart chart = new Chart();SeriesAttributes sa = new SeriesAttributes();sa.Gallery = Gallery.Area;sa.ItemsSource = sd.DataRaw; //Data from 1986 to Presentsa.BindingPath = "Value";sa.BindingPathX = "Date";chart.AxisX.DataFormat.Format = AxisFormat.Date;chart.AxisX.Labels.Format = AxisFormat.Date;chart.AxisX.Min = new DateTime(1999, 1, 1); //This causes OutOfMemoryException//chart.AxisX.Min = new DateTime(1986, 1, 1) <- This works, showing all the datachart.AxisX.Max = DateTime.Today;chart.AxisY.LogBase = 10.0;chart.AxisY.Min = min;chart.AxisY.Max = max;chart.AxisY.AxisStyle = AxisStyles.ShowEnds | AxisStyles.ShowIntermediateLogLabels | AxisStyles.AutoFirstLabel;chart.Series.Add(sa);Thanks!
  8. When creating a multi-pane chart where one pane has an X-Values axis line chart and another pane has a categorical X-Axis bar chart, the bar chart is mislabeled. For example... int[] dataBar = { 100, 200, 300, 400 };string[] labelBar = { "100", "200", "300", "400" };DataPoint[] dataLine = { new DataPoint(new DateTime(2000, 1, 1), 400), new DataPoint(new DateTime(2001, 1, 1), 100), new DataPoint(new DateTime(2002, 1, 1), 300), new DataPoint(new DateTime(2003, 1, 1), 200) };Chart chart = new Chart();Pane pane1 = new Pane();Axis axisX1 = new Axis();Axis axisY1 = new Axis();foreach (string label in labelBar){ axisX1.Labels.Items.Add(label);}axisX1.Labels.HorizontalAlignment = HorizontalAlignment.Right;axisX1.Labels.Position = AxisLabelPosition.Center;axisY1.Min = 0;axisY1.Max = 500;pane1.AxesX.Add(axisX1);pane1.AxesY.Add(axisY1);SeriesAttributes sa1 = new SeriesAttributes();sa1.Gallery = Gallery.Bar;sa1.ItemsSource = dataBar;sa1.AxisX = axisX1;sa1.AxisY = axisY1;pane1.Series.Add(sa1);chart.Series.Add(sa1);chart.Panes.Add(pane1);Pane pane2 = new Pane();Axis axisX2 = new Axis();Axis axisY2 = new Axis();axisX2.DataFormat.Format = AxisFormat.Date;axisX2.Labels.Format = AxisFormat.Date;axisX2.Min = dataLine[0].Date;axisX2.Max = dataLine[3].Date;axisY2.Min = 0;axisY2.Max = 500;axisY2.AxisStyle = AxisStyles.ShowEnds | AxisStyles.AutoFirstLabel;pane2.AxesX.Add(axisX2);pane2.AxesY.Add(axisY2);SeriesAttributes sa2 = new SeriesAttributes();sa2.Gallery = Gallery.Line;sa2.Marker.Visibility = Visibility.Hidden;sa2.ItemsSource = dataLine;sa2.BindingPath = "Value";sa2.BindingPathX = "Date";sa2.AxisX = axisX2;sa2.AxisY = axisY2;pane2.Series.Add(sa2);chart.Series.Add(sa2);chart.Panes.Add(pane2);If I comment out the second pane... //chart.Series.Add(sa2);//chart.Panes.Add(pane2);Or, if I add a second categorical pane, then the labels render correctly. Am I doing something wrong, or is this a bug?
  9. When working with multi-pane charts, theoretically this code: Chart chart = new Chart();for (int i = 0; i < 3; i++){ Pane pane = new Pane(); pane.AxesX.Add(new Axis()); pane.AxesX[0].DataFormat.Format = AxisFormat.Date; pane.AxesX[0].Labels.Format = AxisFormat.Date; pane.AxesY.Add(new Axis()); pane.AxesY[0].Min = min; pane.AxesY[0].Max = max; pane.AxesY[0].AxisStyle = AxisStyles.ShowEnds | AxisStyles.AutoFirstLabel; pane.AxesY[0].Labels.Decimals = 2; SeriesAttributes sa = new SeriesAttributes(); sa.Gallery = Gallery.Line; sa.ItemsSource = sd.Data; sa.BindingPath = "Value"; sa.BindingPathX = "Date"; pane.Series.Add(sa); chart.Panes.Add(pane);} Should produce the same result as this code: Chart chart = new Chart();chart.AllSeries.MultiplePanes = true;for (int i = 0; i < 3; i++){ SeriesAttributes sa = new SeriesAttributes(); sa.Gallery = Gallery.Line; sa.Marker.Visibility = Visibility.Hidden; sa.ItemsSource = sd.Data; sa.BindingPath = "Value"; sa.BindingPathX = "Date"; sa.AxisY = new Axis(); sa.AxisY.Min = min; sa.AxisY.Max = max; sa.AxisY.AxisStyle = AxisStyles.ShowEnds | AxisStyles.AutoFirstLabel; sa.AxisY.Labels.Decimals = 2; sa.AxisX = new Axis(); sa.AxisX.DataFormat.Format = AxisFormat.Date; sa.AxisX.Labels.Format = AxisFormat.Date; chart.Series.Add(sa);}However, the first method causes an exception to be thrown from inside the chart. The second method works fine, but I need to be able to Title each pane and also have HighLow(Open)Close bars on some panes. If I use the "AllSeries.MultiPanes = true" method, then I can't make a pane HLC or HLOC because I have to pass in multiple series for those galleries. What am I doing wrong? Thanks for your help.
  10. It's not guaranteed to be equally spaced. I need to be able to mix line and bar charts where the line would be distorted by gaps in the data if it is forced into a categorical axis. For example, I need to create a financial Price/Volume graph where high/low/open/close bars are on the same graph with moving average lines and a second pane with volume information bars. There can be days where we are missing data and things wouldn't align categorically. It would be a huge problem to have to "vectorize" the data before displaying it to make sure we fill the gaps. Didn't previous versions of ChartFX support bars on an X-values axis?
  11. I am creating a multipanel chart which works fine when displaying each series as a line, but fails to display anything when I change the gallery to a bar chart. Any suggestions? Code sample... DateTime startDate = new DateTime(1999, 1, 1);DateTime endDate = DateTime.Now;Chart chart = new Chart(); chart.AllSeries.MultiplePanes = true;chart.LegendBox.Visibility = Visibility.Collapsed; foreach (Element element in view.Elements){ TimeSeries ts = element as TimeSeries; if (ts != null) { SeriesData sd = new SeriesData(ts.SeriesId, symbol.Id); SeriesAttributes sa = new SeriesAttributes(); double min; double max; sd.GetMinMaxInRange(startDate, endDate, out min, out max); sa.Gallery = Gallery.Bar; sa.Marker.Visibility = Visibility.Hidden; sa.ItemsSource = sd.Data; sa.BindingPath = "Value"; sa.BindingPathX = "Date"; sa.AxisY = new Axis(); sa.AxisY.Min = min; sa.AxisY.Max = max; sa.AxisY.AxisStyle = AxisStyles.ShowEnds | AxisStyles.ShowIntermediateLogLabels | AxisStyles.AutoFirstLabel; sa.AxisY.Labels.Decimals = 1; sa.AxisX = new Axis(); sa.AxisX.DataFormat.Format = AxisFormat.Date; sa.AxisX.Labels.Format = AxisFormat.Date; sa.AxisX.FontSize = 14; sa.AxisX.Title.Content = ts.Title; sa.AxisX.Title.FontSize = 20; sa.AxisX.Min = startDate; sa.AxisX.Max = endDate; chart.Series.Add(sa); }}
×
×
  • Create New...