Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1895

Summary: Two issues with PDF export in WPF
Product: .NET TeeChart Reporter: christopher ireland <chris>
Component: WPFAssignee: Steema Issue Manager <issuemanager>
Status: IN_PROGRESS ---    
Severity: normal    
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description christopher ireland 2017-07-18 10:13:19 EDT
The following code demonstrates three issues with PDF export in WPF:
1) custom DashStyles are not exported correctly
2) the ColorLine tool is not exported successfully
3) transparent colors are not exported correctly

    public MainWindow()
    {
      InitializeComponent();

      chtExample.Legend.LegendStyle = LegendStyles.Series;
      Line l1 = new Line(chtExample.Chart);
      l1.FillSampleValues(300);

      HorizLine hl = new HorizLine(chtExample.Chart);
      DashStyle hlStyle = new DashStyle(new double[] { 8, 7, 8, 7, 2, 7 }, 0);
      hl.Legend.Visible = false;
      hl.Color = Color.FromArgb(255, 0, 150, 20);
      hl.LinePen.Width = 1;
      hl.LinePen.Style = hlStyle;
      //hl.LinePen.Style = DashStyles.DashDotDot;

      Steema.TeeChart.WPF.Tools.ColorLine cl = new Steema.TeeChart.WPF.Tools.ColorLine(chtExample.Chart);
      cl.Axis = chtExample.Axes.Left;
      cl.AllowDrag = false;
      cl.Pen.Color = Color.FromArgb(255, 209, 17, 0);
      cl.Pen.Width = 1;
      cl.Pen.DashCap = PenLineCap.Triangle;
      DashStyle stl = new DashStyle(new double[] { 8, 7, 8, 7, 2, 7 }, 0);
      cl.Pen.Style = stl;
      //cl.Pen.Style = DashStyles.DashDotDot;
      cl.Active = true;

      Steema.TeeChart.WPF.Tools.ColorBand cb = new Steema.TeeChart.WPF.Tools.ColorBand(chtExample.Chart);
      cb.Axis = chtExample.Axes.Left;
      cb.Brush.Color = Color.FromArgb(85, 128, 255, 128);
      cb.Brush.Gradient.Transparency = 20;
      cb.Active = true;

      DataTable dt = ((DataSet)l1.DataSource).Tables[0];
      float s = Convert.ToSingle(dt.Compute("AVG(Y)", ""));
      cl.Value = Math.Round(s, 2);

      cb.Start = Math.Round(s * .67, 3);
      cb.End = Math.Round(chtExample.Axes.Left.MaxYValue * .67, 3);

      hl.Add(chtExample.Axes.Bottom.MinXValue, chtExample.Axes.Left.MaxYValue * 0.95); hl.Add(chtExample.Axes.Bottom.MaxXValue, chtExample.Axes.Left.MaxYValue * 0.95);
    }

    private void btnExport_Click(object sender, RoutedEventArgs e)
    {
      SaveFileDialog saveFileDialog = new SaveFileDialog();
      saveFileDialog.FileName = "TeeChart_pdf_Export";
      saveFileDialog.DefaultExt = ".pdf";
      saveFileDialog.Filter = "pdf Documents (.pdf)|*.pdf";

      if (saveFileDialog.ShowDialog() == true)
      {
        chtExample.Export.Image.PDF.Save(saveFileDialog.FileName);
        System.Diagnostics.Process.Start(saveFileDialog.FileName);
      }
    }
Comment 1 christopher ireland 2017-08-31 03:38:04 EDT
WPF colorline tool (and all other adorners) now accessible to export routines - changes made in commit 9b75525a.